klapy Posted April 7, 2006 Share Posted April 7, 2006 I have a problem with adding content to a textareaWhat 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[code]<textarea name="news" class="txtbox" rows="10" cols="30"><?php echo $assoc['news']?></textarea>[/code]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.... Quote Link to comment https://forums.phpfreaks.com/topic/6792-white-spaces-in-textarea/ Share on other sites More sharing options...
zq29 Posted April 7, 2006 Share Posted April 7, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/6792-white-spaces-in-textarea/#findComment-24808 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.