What\'s the best way of validating an HTML text input as it\'s typed? All ways I know of doing it has some drawbacks:
Using $.keypress you only
Just for another solution to prevent certain characters, without JQuery...
...
function checkInput(e)
{
//only alpha-numeric characters
var ok = /[A-Za-z0-9]/.test(String.fromCharCode(e.charCode));
if (!ok)
e.preventDefault();
}
I don't know if this requires new versions of things or only works on some browsers. Please comment.