Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting maxlength of textarea?

Status
Not open for further replies.

mrdance

Programmer
Apr 17, 2001
308
0
0
SE
How can I do that?
 
mrdance,

<input type=&quot;text&quot; name=&quot;Name&quot; maxlength=&quot;20&quot;>

this what youre after? Hope it helps ;)

~ jsLove
 
No, textarea <TEXTAREA NAME=message></TEXTAREA>
 
you can try it :)


<script language=&quot;JavaScript&quot;><!--
function validate(what) {
if (what.length > 10) {
alert('Must be less than 10 characters');
return false;
}
return true;
}
//--></script>

<form name=&quot;formName&quot; onSubmit=&quot;return validate(documents.formName.textName.value)&quot;>
<textarea name=&quot;textName&quot; onChange=&quot;validate(this.value)&quot;></textarea>
</form>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top