Hi, i'm trying to change a div tag value to the new countdown value. The count down is for a text box only allowing 50 characters, can't seem to get the elementByID correct, this is what i have:
//Thanks for reading this
//Thanks for reading this
Code:
<head>
<script language="javascript" type="text/javascript">
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
limitField.value = limitField.value.substring(0, limitNum);
} else {
document.getElementById("countdown").innerHTML = limitNum - limitField.value.length;
}
}</script>
</head>.....<body>
<input name='limitedtextfield' type='text' onKeyDown='limitText(this.form.limitedtextfield,this.form.countdown,50);' onKeyUp='limitText(this.form.limitedtextfield,getElementById("countdown").innerHTML,50);' maxlength='50'>
(Maximum characters: 50<div id='countdown'>50</div>)