Remove special characters in a control in Javascript

By [)ia6l0 iii

We can use Regex to clear special characters in a control

The sample code below shows you how to do that:

function RemoveSpecialCharacters(control)
{
control.value =control.value.replace(/[^0-9a-zA-Z_]/g,'');
}

Remove special characters in a control in Javascript  (1131 Views)