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,\'\')


Thank you for visiting Bear River Web Design, we have a Special Offer for you!

Call Jeanie at 530-324-2327 to schedule a FREE, No-Obligation Consultation.
Mention this ad for 10% off our Informational Website Package through the month of September!