Log in

View Full Version : new row if enter is pressed?



Dennis_Gull
04-20-2007, 09:06 PM
Hey, I need to change the row when I press enter but I dont want to use the textarea tag because of the scroller on the right. Some browser always have them even if its not needed... Anyways how can I change row if it looks something like this:


<td>
my text here

and here
</td>

And I want it to look like this:
My text here

and here

instead of: My text here and here

Edit:

This may belong to the php section, anyways I use php so if theres some function I can use I would love to find out how it works :)

Edit again:

Got it to work

thetestingsite
04-21-2007, 02:01 AM
You could use nl2br (http://php.net/nl2br) function in php to accomplish this, if I understand you correctly. Something else you could try is simply inserting a <br> in between the lines of text. So this:



<td>
my text here

and here
</td>


would be this:



<td>
my text here<br>
<br>
and here
</td>


and that will ouput like so:



my text here

and here


Hope this helps.

Dennis_Gull
04-21-2007, 07:50 AM
Yeah nl2br was what I used, the reason why I wanted it as normal text is because the text is supposed to be posted by others on my site.