I am using this code to prevent entering special chars
String.prototype.isText = function () {return /^[\w\s&'%]*$/.test(this)}
But i want it to allow entering dots in the string.
How can i change it to do that ?
Thanks
Add a dot:
String.prototype.isText = function () {return /^[\w\s&'%.]*$/.test(this)}
String.prototype.isText = function () {return /^[\.\w\s&'%]*$/.test(this)}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With