By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,304 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,304 IT Pros & Developers. It's quick & easy.

textarea adds unwanted spaces

P: 14
Expand|Select|Wrap|Line Numbers
  1. <TEXTAREA NAME="comments" ROWS="10" COLS="50">
  2.         <?php  echo $comments; ?>
  3. </TEXTAREA>
  4.  
  5. this is a very simple question. the textarea above automatically adds three tab spaces at the beginning. as a result, when i try to check it using javascript
  6.  
  7.  if(theform.comments.value == "")
  8.      {
  9.            //some code here
  10.      }
  11.  
it never becomes null even if no input has been made. i know this is a very simple question but i can't really figure out what's wrong.

Please enclose any code within the proper code tags. See the Posting Guidelines on how to do that. - moderator
Mar 2 '08 #1
Share this Question
Share on Google+
2 Replies


dlite922
Expert 100+
P: 1,584
try this:
[PHP]
<TEXTAREA NAME="comments" ROWS="10" COLS="50"><?php echo $comments; ?></TEXTAREA>
[/PHP]

no spaces between <textarea></textarea>
Mar 2 '08 #2

P: 14
try this:
[PHP]
<TEXTAREA NAME="comments" ROWS="10" COLS="50"><?php echo $comments; ?></TEXTAREA>
[/PHP]

no spaces between <textarea></textarea>
hi, i figured this out too a while a go. it turned out the i coded the ff:
<texarea>
<?php echo $comments; ?>
</textarea>

so, that explained the spaces. thanks for the reply
Mar 2 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.