<html>
<head>
<script type="text/javascript">
function check()
{
var val = document.myForm.content.value;
if (val.length <= 10)
{
document.getElementById('numC').value = val.length;
//out.value = val.length;
}
else
document.write("Please enter the text in range of 10 characters!");
return false;
}
</script>
</head>
<body>
<form name="myForm">
Type something here:
<input type"textbox" value="" name="content" onchange ="check()">
<br/><br/>
Lenght of string you enter:<input type="text" id="numC">
</form>
</body>
</html>
Here is my code with the requirement: when I type text into the first input cell, the number of characters will be appear in the next cell, or if the number of character is greater than 10, the inform will be appear.
But I don't know how the inform will appear immediately if the tenth character is typed!
Please help me!
Thank you!