PDA

View Full Version : Converting "" into "


pcproff
06-01-2009, 09:48 PM
Hi all,

I searched for this on Google to no success so I figured I would come to my next best resource. I have a page that I created and I need to make sure that anyone who types text into a field and uses single quotes or double quotes it will convert it to " and ´ respectively. Is this possible with JS?

A1ien51
06-01-2009, 10:38 PM
var myString = '""""""';
myString = myString.replace(/"/g,""");
alert(myString)

Eric

pcproff
06-01-2009, 10:56 PM
var myString = '""""""';
myString = myString.replace(/"/g,""");
alert(myString)

Hey Eric thanks for the fast response will this take anywhere a user inputs a "" and replace it with " ?