Jump to content


Photo

white spaces in textarea


  • Please log in to reply
1 reply to this topic

#1 klapy

klapy
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 07 April 2006 - 09:03 AM

I have a problem with adding content to a textarea

What i'm trying to do is make a database driven newspage...
When i'm modifying it I want to see the old values in a textarea so I can change it

<textarea name="news" class="txtbox" rows="10" cols="30"><?php echo $assoc['news']?></textarea>

The text from the database get's entered correctly but after the text are a lot of spaces and I cant figure out an easy way to remove them!

This only happens if I use phpfunctions to display the data, if I type the text it get's displayed as it should....

edit: Problem solved itself....

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 07 April 2006 - 04:42 PM

Glad you got it solved.

For people that have found this thread because they are having a similar problem, this generally happens when you have the textarea tags on different lines, if you have put them all on the same line and the problem still persists, try running the defult content through trim() to strip white space from the begining and end of the string.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users