rgb192
asked on
javascript count characters in an input textbox
this counts characters
in an input textbox
but I want to display the character count next to the textfield
in the form
because I have a large form
in an input textbox
but I want to display the character count next to the textfield
in the form
because I have a large form
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title></title>
<script>
function changeContent(){
var txt = document.getElementById('testtext').value;
document.getElementById('dest').innerHTML = txt;
}
function countChars(){
var len = document.getElementById('testtext').value.length;
document.getElementById('dest').innerHTML = len;
}
</script>
</head>
<body>
<form name='test' action='test.html' method='post'>
<input type="text" id="testtext" name="testtext" onkeyup="countChars();">
</form>
<table>
<tr>
<td id='dest'></td>
</tr>
</table>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
Thanks for the points!
http://www.hscripts.com/scripts/JavaScript/character-count.php