Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2008
    Posts
    116
    Thanks
    2
    Thanked 0 Times in 0 Posts

    problem in using text area

    hi friends,
    I got some annoying issues with textarea element.
    I can't validate that <textarea> is empty inside if statement.
    this is the HTML code
    Code:
    <textarea rows="6" cols="80" name="message" style="margin-top:20px;border:solid 1px #B7F0FF;" wrap="virtual">	     
    	   </textarea>
    I didn't enter any text inside this textarea element but when I apply the condition
    if(message.value="") return true;

    the condition becomes false that should have been true;
    one more thing, when I checked this property message.value.length, it gives the value 11 not 0 while the textarea is empty.

    how can I make this problem solved?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,853
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Remove the line break and make it like
    Code:
    <textarea rows="6" cols="80" name="message" style="margin-top:20px;border:solid 1px #B7F0FF;" wrap="virtual"></textarea>
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •