<script
language="javascript"
type="text/javascript">
function
checkchars(form)
{
var
max=15;
if
(form.chars.value.length
>
max)
{
alert("Please
do not enter more than 15 characters. Please shorten your entry and
submit again.");
return
false;
}
else
return
true;
}
function
Count(forM)
{
var
count =
forM.chars.value.length;
document.getElementById('CharsCount').innerHTML='<b>'+count+'</b>';
}
</script>
<form
onsubmit="return
checkchars(this)">
Please type 15 characters or less.<br>
<textarea
rows=5
cols=30
name=chars
wrap=virtual
onKeyUp="Count(this.form)"></textarea>
<br><input
type=submit
value="Submit!">
</form>
<span
id="CharsCount"></span>