If the user enters quotes around a string they are entering, how is it that I can strip the quotes off and then reassign the string to the text box. Please show some sample code if you can? Thank you.
<html> <head> <script language="javascript"> function stripThoseQuotes(chr) { if(chr.indexOf('"') != -1) { document.frmNoQuotes.noquotes.value = chr.replace('"',''); } } </script> <body> <form name="frmNoQuotes"> <input type="text" name="noquotes" onkeypress="stripThoseQuotes(this.value);"> </form> </body> </html> You could trigger this function from any event, such as an onsubmit of the form, which would be more effective. hope that helps.
the function replace is used with regular expressions,isn't it? the function should be more basic like: function removeCharacter(str){ for(var i = 0;i < str.length;++){ str[i] = (str[i] == '\"' ? "" : str[i]) } }
How can I take a string that is selected from a drop down menu and check to see if it has double quotes around it, if it does, then remove the quotes and submit the new string without quotes instead of the one selected? Please help....urgent!!!
isnt there a regular expression that could be used to remove quotes from a sting? i have this same problem, but the strings that i'm working with are very long, and i need to remove the quotes rapidly thanks centipede