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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.