I have an issue that I'm trying to figure out. This is what I have so far and it seems to work the way it was but when I add in a php variable to auto popuplate the input field, it doesn't seem to calculate the characters used.
This field has a max value of 80 characters which I cannot control. I have to limit it ot 80 characters max. I need the input field to aut calculate once the form loads and the field is populated. When I include the php variable to the input value, the input field shows the field filled up with characters however, the field stays at "zero" characters until I move the mouse in the field and try to add another character.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<script type="text/javascript">
document.testform.countInput.focus();
function countChars(countfrom,displayto) {
var len = document.getElementById(countfrom).value.length;
document.getElementById(displayto).innerHTML = len;
}
</script>
<form id="testform">
Title: <strong id="countOutput">0</strong><strong>/80 Max Character</strong>
<input type="text" name="dsp_URL" value="" size="80" maxlength="80" lengthcut="true" id="countInput" onkeyup="countChars('countInput','countOutput');" /><br />
</form>
<script type="text/javascript">
var input = document.getElementById ("countInput");
input.focus ();
</script>
<body>
</body>
</htmt>