how to remove the specialized characters from field value

yadav1
Kilo Expert

please provide me answer

by using substring function we need scripting tell me any body

3 REPLIES 3

Anurag Tripathi
Mega Patron
Mega Patron

var value = this.value;
value
= value.replace(/[^a-zA-Z0-9]+/g, '-');   // special char(s) -> hyphen
value
= value.replace(/^-|-$/g, ''); // remove leading/trailing hyphen


-Anurag

zac
Mega Contributor

And here's a link to help you understand what Anurag posted:



Regular Expressions - JavaScript | MDN


app
Mega Expert

Hi,

Same problem I am facing

If giving '&' in description its giving some error.

 

Please help