I need this character count to NOT include spaces typed in each of the 4 fields.
Can you help?
Thanks!
MY CODE:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<title>Untitled Document</title>
<script type="text/javascript">
function countChars()
{
document.form1.count_display.value = (document.form1.text_1.value.length + document.form1.text_2.value.length + document.form1.text_3.value.length + document.form1.text_4.value.length);
}
</script>
</head>
<body>
<form action="" name="form1" id="form1">
<p><input name="text_1" onkeyup="countChars();" onblur="countChars();" /></p>
<p><input name="text_2" onkeyup="countChars();" onblur="countChars();" /></p>
<p><input name="text_3" onkeyup="countChars();" onblur="countChars();" /></p>
<p><input name="text_4" onkeyup="countChars();" onblur="countChars();" /></p>
<br />
<p>Char Count: <input type="text" name="count_display" value="0" size="4" readonly="readonly" /></p>
</form>
</body>
</html>
Can you help?
Thanks!
MY CODE:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<title>Untitled Document</title>
<script type="text/javascript">
function countChars()
{
document.form1.count_display.value = (document.form1.text_1.value.length + document.form1.text_2.value.length + document.form1.text_3.value.length + document.form1.text_4.value.length);
}
</script>
</head>
<body>
<form action="" name="form1" id="form1">
<p><input name="text_1" onkeyup="countChars();" onblur="countChars();" /></p>
<p><input name="text_2" onkeyup="countChars();" onblur="countChars();" /></p>
<p><input name="text_3" onkeyup="countChars();" onblur="countChars();" /></p>
<p><input name="text_4" onkeyup="countChars();" onblur="countChars();" /></p>
<br />
<p>Char Count: <input type="text" name="count_display" value="0" size="4" readonly="readonly" /></p>
</form>
</body>
</html>