Jump to content


This topic is now archived and is closed to further replies.


white spaces in textarea

Recommended Posts

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....

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.