B
Blue
This JS limits the input characters into the form. How do I modify it
so that it also allows CARRIAGE RETURN and BACKSPACE (for making text
correction)?
Due to the template engine I am using, I cannot use IF/ELSE statement.
==============================
<form>
<textarea name="event_description" ONKEYPRESS="if (document.layers)
var c = event.which;
else if (document.all)
var c = event.keyCode;
else
var c = event.charCode;
var s = String.fromCharCode(c);
return /[0-9a-zA-Z\s,.?!@#$%&*()-]/.test(s);"></
textarea>
</form>
so that it also allows CARRIAGE RETURN and BACKSPACE (for making text
correction)?
Due to the template engine I am using, I cannot use IF/ELSE statement.
==============================
<form>
<textarea name="event_description" ONKEYPRESS="if (document.layers)
var c = event.which;
else if (document.all)
var c = event.keyCode;
else
var c = event.charCode;
var s = String.fromCharCode(c);
return /[0-9a-zA-Z\s,.?!@#$%&*()-]/.test(s);"></
textarea>
</form>