I have a textbox, and it needs not allow the user to enter any special characters. He can enter:
O
This function will check the string given to it for those criteria:
function checkvalue(value) { return value.match( /[A-Za-z][A-Za-z0-9 ]*/ ); }
You can then use that in an onkeypress event, passing in the current value.