textarea adds unwanted spaces

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • watusiboy
    New Member
    • Jan 2008
    • 14

    textarea adds unwanted spaces

    Code:
    <TEXTAREA NAME="comments" ROWS="10" COLS="50">
    		<?php  echo $comments; ?>
    </TEXTAREA>
    
    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: 
    
     if(theform.comments.value == "")
         {
               //some code here
         }
    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
    Last edited by ronverdonk; Mar 2 '08, 11:14 AM. Reason: code tags
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

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

    no spaces between <textarea></textarea>

    Comment

    • watusiboy
      New Member
      • Jan 2008
      • 14

      #3
      Originally posted by dlite922
      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

      Comment

      Working...