Javascript: Properly Setting A Text Area

Posted by Jeremy Person on Stack Overflow See other posts from Stack Overflow or by Jeremy Person
Published on 2010-04-27T23:19:40Z Indexed on 2010/04/27 23:23 UTC
Read the original article Hit count: 173

Filed under:

I have a text area and the problem is people are typing a large amount of text and I have it clearing out the value and forcing an N/A so I can force something to be entered. How can I make the script below validate someone has already typed something (and not clear it out) but still clear out the N/A by default?

textarea name="req_WhatMadeItDifficultToUse" cols="35" onfocus="this.value = '';" onblur="if(this.value == '') this.value = 'N/A';" id="WhatMadeItDifficultToUse">N/A

© Stack Overflow or respective owner

Related posts about JavaScript