R
roN
Hey,
I got following:
[js]
<script language="JavaScript">
var max = 255;
document.Formular.input1.value = max;
document.Formular.comments.focus();
function count(e) {
if (!e.which) keyCode = event.keyCode; // ie5+ op5+
else keyCode = e.which; // nn6+
if (document.Formular.comments.value.length<max+1)
document.Formular.input1.value =
max-document.Formular.comments.value.length;
else {
document.Formular.comments.value =
document.Formular.comments.value.substring(0,max);
document.Formular.input1.value = 0;
}
}
</script>
[/js]
That's supposed to display how many chars are left besides the textarea,
decreasing from 255. But it doesn't display anything, why not? Thank you
guys!
I got following:
HTML:
<form name="Formular" method="post" onSubmit="return chkFormular()"
action="mail.php" enctype="text/plain">
....
....
....
<td align="right" valign="top" class="text"><font
color='red'>*</font>Comments/Questions:<br>
<input name="input" size="1"
style="border-width:0;background-color:#FFFFFF"
onfocus="if(this.blur)this.blur()">
chars left</td>
<td class="text"> <textarea name="comments"
onkeyup="count(event)" rows="8" cols="40" class="flat"></textarea>
</td>
<script language="JavaScript">
var max = 255;
document.Formular.input1.value = max;
document.Formular.comments.focus();
function count(e) {
if (!e.which) keyCode = event.keyCode; // ie5+ op5+
else keyCode = e.which; // nn6+
if (document.Formular.comments.value.length<max+1)
document.Formular.input1.value =
max-document.Formular.comments.value.length;
else {
document.Formular.comments.value =
document.Formular.comments.value.substring(0,max);
document.Formular.input1.value = 0;
}
}
</script>
[/js]
That's supposed to display how many chars are left besides the textarea,
decreasing from 255. But it doesn't display anything, why not? Thank you
guys!