You are here: irt.org | FAQ | JavaScript | Text | Q709 [ previous next ]
Try:
<SCRIPT LANGUAGE="JavaScript"><!-- function validated(string) { for (var i=0, output='', valid="123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; i<string.length; i++) if (valid.indexOf(string.charAt(i)) != -1) output += string.charAt(i) return output; } //--></SCRIPT> <FORM> <INPUT TYPE="TEXT" onChange="this.value=validated(this.value)"> </FORM>