Jump to content

white spaces in textarea


klapy

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.