Remove special characters on value change.

By Carlton Colter - Last updated: Thursday, October 1, 2009 - Save & Share - Leave a Comment

This blog entry contains some helpful information about removing special characters from a string using javascript. I was able to modify it to be just a few of code in an onchange event. Just rename new_name to the attribute your correcting.

if (crmForm.all.new_name.DataValue && crmForm.all.new_name.DataValue.length >0)
{
crmForm.all.new_name.DataValue = crmForm.all.new_name.DataValue.replace(/[^a-zA-Z 0-9]+/g,'');
}
Posted in Scripts • Tags: , , , , , , Top Of Page

Write a comment