need to allow apostrophe in textbox byusing javascript function
-
Hai all, i had one function which does not accept apostrophies for the text box but i need to accept the apostrophe for the textbox can any one help me...i am new to javascript... }else if(c.indexOf(' validate-address ')!=-1&&t.replace(/ /g,'').replace(/[,]/g,'').replace(/[.]/g,'').match(/\W/)){valid=false;
Thanks Subbu.
-
Hai all, i had one function which does not accept apostrophies for the text box but i need to accept the apostrophe for the textbox can any one help me...i am new to javascript... }else if(c.indexOf(' validate-address ')!=-1&&t.replace(/ /g,'').replace(/[,]/g,'').replace(/[.]/g,'').match(/\W/)){valid=false;
Thanks Subbu.
Just remove the apostrophes from the string before the match. Why do you have to many replace calls when you can do all the replacing in one?
}else if(c.indexOf(' validate-address ')!=-1&&t.replace(/[ ,.']+/g,'').match(/\W/)){valid=false;
Despite everything, the person most likely to be fooling you next is yourself.