function allow_alphaNumeric(obj){ if (/[^\w]/i.test(obj.value)) obj.value=obj.value.replace(/[^\w]/gi,'') obj.value+='' obj.focus() }