![]() |
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.
|
Did you use breaks in the code?
|
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. |
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.
|
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.
|
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>. |
@kruptof sorry i didnt realize that. i thought it was a webpage the you needed only single line returns in.
|
| All times are GMT -5. The time now is 12:24 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC