spicymango
Programmer
I am checking to see my string has any of the following characters. The way I am doing it, I can test for all except double quotes ". If I put double quote that beaks my string.
I don't know the way around it.
I don't know the way around it.
Code:
<script>
var frenchdisplaystring="";
var setFrenchFlag="";
var french = "àÀâÂäÄáÁéÉèÈêÊëËìÌîÎïÏòÒôÔöÖùÙûÛüÜçÇ’ñ€Æ»«æ'.;-&";
var name = ".;-&kitty 12àÉ'";
//looping through the text that needs to be validated
for(var i=0; i<name.length; i++) {
var namechar = name[i];
//looping through the French characters
for(var a=0; a<french.length; a++) {
var frenchchar = french[a];
if (namechar == frenchchar )
{
setFrenchFlag = "1";
frenchdisplaystring = frenchdisplaystring + " \\"+frenchchar;
}
}
}
alert(frenchdisplaystring);
</script>