Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 28th, 2006, 2:43 PM   #1
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 330
Rep Power: 3 kruptof is on a distinguished road
TextArea missing newline

when ever the user hits the return key to go onto the next line and they typed their text on the next line and i sumbit that text, that text appears all on the same line,does anybody how to overcome this......i thank you in advance for your replies.
__________________
Quote:
When I was young it seemed that life was so wonderful,a miracle, oh it was beautiful, magical.
Now watch what you say or they'll be calling you a radical,a liberal, oh fanatical, criminal. Oh won't you sign up your name,we'd like to feel you're acceptable, respectable, oh presentable, a vegetable
kruptof is offline   Reply With Quote
Old Jul 30th, 2006, 4:38 PM   #2
Mr. John
Newbie
 
Join Date: Jul 2006
Location: In front of my computer
Posts: 6
Rep Power: 0 Mr. John is on a distinguished road
Did you use breaks in the code?
Mr. John is offline   Reply With Quote
Old Jul 31st, 2006, 8:04 AM   #3
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 582
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
go to the code and but <br> where you want to
start a new line(like this).

It will not put a space between like shown.
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Old Jul 31st, 2006, 9:19 AM   #4
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 330
Rep Power: 3 kruptof is on a distinguished road
crawforddavid2006::since this is a text that is inputted by the user i don't know where the new line will occur...........Mr.John::how do i make the Text area use line breaks......don't you mean multi line......well the text area is multiline......thanks for the help so far.
__________________
Quote:
When I was young it seemed that life was so wonderful,a miracle, oh it was beautiful, magical.
Now watch what you say or they'll be calling you a radical,a liberal, oh fanatical, criminal. Oh won't you sign up your name,we'd like to feel you're acceptable, respectable, oh presentable, a vegetable
kruptof is offline   Reply With Quote
Old Jul 31st, 2006, 9:41 AM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Sure you know where the user put a newline. Locate it in the text and replace it with a break or add a break to it. The newline is treated in rendering as just more whitespace. That's why lines wrap to accomodate the width of the page and the text size selected. If you're using PHP to receive the submittal there's even a built-in function (NL2BR if I recall correctly). Otherwise, look at the tools for whatever you're using, or roll your own.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Jul 31st, 2006, 11:14 AM   #6
v0id
Hobbyist Programmer
 
Join Date: Apr 2006
Posts: 155
Rep Power: 3 v0id is on a distinguished road
Like DaWei said, you just need to look the input trough for finding linebreaks, you can do this in PHP with the, like DaWei also said, nl2br($variable);
In ASP you have to replace vbCrLf with <br>.
__________________
-- v0id

Last edited by v0id; Jul 31st, 2006 at 11:35 AM.
v0id is offline   Reply With Quote
Old Jul 31st, 2006, 12:45 PM   #7
crawforddavid2006
Expert Programmer
 
crawforddavid2006's Avatar
 
Join Date: Apr 2005
Location: Not sure yet
Posts: 582
Rep Power: 0 crawforddavid2006 is an unknown quantity at this point
Send a message via AIM to crawforddavid2006 Send a message via MSN to crawforddavid2006
@kruptof sorry i didnt realize that. i thought it was a webpage the you needed only single line returns in.
__________________
Quote:
Originally Posted by DaWei View Post
Well, it's better than Pen Islands url....;)

crawforddavid2006 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
C# corruption!!! Kilo C++ 32 May 21st, 2006 8:44 PM
Help with this. Can you check what's missing? DBZ C++ 2 Mar 17th, 2006 11:39 PM
newline in javascript Intimidat0r JavaScript and Client-Side Browser Scripting 4 Jan 29th, 2006 1:03 PM
Error in checking for newline aznluvsmc C 7 Aug 25th, 2005 5:13 AM
Textarea, PHP & MySQL stakeknife PHP 1 Apr 4th, 2005 8:31 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:11 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC