Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > JavaScript > Limit textarea ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 4 Topic 35504 of 36380
Post > Topic >>

Limit textarea alert message

by "teser3@[EMAIL PROTECTED] " <teser3@[EMAIL PROTECTED] > May 6, 2008 at 06:21 PM

I have the below that limits the textarea input to 500 characters but
cant get the alert message to work.  It doesnt show anything.  Please
advise.
<script language="javascript" type="text/javascript">
function limitText(limitField, limitCount, limitNum) {
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
                                alert("You are trying to enter more
than 500 characters");
	} else {
		limitCount.value = limitNum - limitField.value.length;
	}
}
</script>
--------------------------------------------------------------------------------

<form name="myform">
<textarea name="limitedtextarea"
onKeyDown="limitText(this.form.limitedtextarea,this.form.countdown,
500);"
onKeyUp="limitText(this.form.limitedtextarea,this.form.countdown,
500);">
</textarea>
 




 4 Posts in Topic:
Limit textarea alert message
"teser3@[EMAIL PROTE  2008-05-06 18:21:09 
Re: Limit textarea alert message
Lasse Reichstein Nielsen   2008-05-07 07:12:36 
Re: Limit textarea alert message
"Evertjan." <  2008-05-07 07:54:07 
Re: Limit textarea alert message
"Evertjan." <  2008-05-07 08:17:42 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 23:23:57 CDT 2008.