Javascript Replace Reserved Special Characters in Form Field

Javascript Replace Reserved Special Characters in Form Field

02.24.2011
Written by: J. Zatkulak

Need to remove special reserved characters in form fields?
Here you go - setup your field like this:

onBlur="var val = form.CurrentMonth.value; if (val) form.CurrentMonth.value=val.replace(\\$|,|@|#|~|`|\%|\*|\^|\\&|\(|\)|\+|\=|\[|\-|\_|\]|\[|\}|\{|\;|\:|\\'|\<|\>|\?|\||\\\|\!|\\$|\./g,\'\')