Jump to content

Escape Problem


RIRedinPA

Recommended Posts

I have a select list with names from our global email address list. Users can select multiple names to customize an email list within an app I am developing. The select list is formed like this

 

<option value="fname lname(FLname)">fname lname(FLname)</option>

 

I'm using this JS to get the selected names

 


var theselect = document.customemaillist.gal;
var theSelectedIndexes = new Array(); 
while (theselect.selectedIndex != -1) { 
	if (theselect.selectedIndex != 0)  { 
		var thename =escape(theselect.options[theselect.selectedIndex].value)
		alert(escape(theselect.options[theselect.selectedIndex].value));
		theSelectedIndexes.push(thename); 
		theselect.options[theselect.selectedIndex].selected = false;
	}
} 

 

Problems is with names like this FName O'LastName I'm getting results like this:

 

FName%20O

 

why isn't escape(theselect.options[theselect.selectedIndex].value) making the value FName%20O\'LastName?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/157105-escape-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.