View Full Version : escaping '
04-27-2004, 09:49 AM
So How can I escape the ' character
ex. When its filled in @ a form?
04-27-2004, 10:24 AM
You escape a character by using backslash before the character
04-27-2004, 10:32 AM
But when I use that at my Replace function
It still doesnt work
04-27-2004, 11:11 AM
You are in effect replacing ' with the same '
I don't know why do you want to change it but try this:
That will insert a "literal" backslash inside the original string. I don't know if that's what you want.
var str="I'm happy";
str = str.repAp();
alert(str); //alerts I\'m happy
Can you elaborate more on this, I'm curious why do you want to do that.
04-27-2004, 11:52 AM
eval("document.formulier.str1" + i + ".value='" + eval("document.formulier.str1" + i + ".value.toLowerCase().repAp;") + "'");
and my function
04-27-2004, 11:58 AM
You're having trouble with single quotes because you are using eval which should not be used in the first place.
document.formulier.elements["str1" + i].value=document.formulier.elements["str1" + i].value.toLowerCase();
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.