FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


text formatting inside of textarea adds white space





ammonkc
I have a textarea in a html form. the text is inserted into a mysql db. if there is aready text in the mysql db then I echo the text into the textarea in my php script. but when I echo text into the text area it always appends about an inch of white space to the begining. I've tried everything that I can think of to get rid of this whitespace. I trim() the variable before I insert into mysql, and i even trim() the variable that I pull out of mysql before it is echo'd. i also use nl2br() on the variable before it is echo'd. but the whitespace is still there. this is an example of how i'm echoing the data from mysql into the textarea:

Code:

<textarea name="notes" cols="50" rows="3" id="notes">
   <?php if ($row['notes']!="") {echo nl2br(trim($row['notes'])); } ?>
</textarea>


anyone know how I get rid of this whitespace problem? i've tried everything that I can think of.
Mahalo in advance,
Ammon
mathiaus
remove the php tag indent!

Code:
<textarea name="notes" cols="50" rows="3" id="notes"><?php if ($row['notes']!="") {echo nl2br(trim($row['notes'])); } ?></textarea>
ammonkc
Thanks! I knew it must've been something really stupid like that. I feel pretty silly that I didn't catch that. Big thanks for that one. I was about to get into some other php functions for trimming and stripping. saved me sometime with that post
Related topics
Philosophy
751 Useful Windows XP Files
Create the Flash Logo (Photoshop Tutorial)
14 ways to add content to your web site and attract visitors
V Bulletin dökümanlarý
SEARCHING FOR MR. GOOD-WAR
Visual Basic Tutorial - File I/O in VB: Text Files
Trouble with css positioning
liquid design problem
If you have created a form on your site you can help...
The matrix online hints and tips
~ FriHost Redesign Project ~
TYpography tips
what are after dot function for?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.