-
Notifications
You must be signed in to change notification settings - Fork 0
/
charvalidation.html
23 lines (23 loc) · 808 Bytes
/
charvalidation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<<<<<<< HEAD
<html>
=======
<html>
>>>>>>> abe8443cc6bb46a138a421652f5bd0fa2f0e8ad4
<head>
<script language="javascript" type="text/javascript">
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
} else {
limitCount.value = limitNum - limitField.value.length;
}
}
</script>
</head>
<form name="myform">
<input name="limitedtextfield" type="text" onKeyDown="limitText(this.form.limitedtextfield,this.form.countdown,25);"
onKeyUp="limitText(this.form.limitedtextfield,this.form.countdown,25);" maxlength="25"><br>
<font size="3">(Maximum characters: 25)<br>
You have <input readonly type="text" name="countdown" size="4" value="25"> characters left.</font>
</form>
</html>