Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Form Value to Unescaped URL Parameter 2

Status
Not open for further replies.

jay07

Programmer
Dec 15, 2005
19
US
Hi-

I am trying, so far without success, to set a form field value to an unescaped URL parameter. Here is the story. A recipient of email from us click an opt-out button and jumps to an opt out page. The URL of that opt-out page has the recipient's email address appended to the URL as a parameter. But the URL has the "@" symbol in the email encoded into "%40", so I have to unescape it to convert the "%40" back to an "@" symbol. So the URL looks like ...company.com/page/emailoptout.htm?emailname%40yahoo.com

In my header I have script to try to set my "emailoptout" form's "email" field value to the unescaped URL parameter:

<script language="javascript" >
function populate()
{
document.optoutform.email.value=unescape(window.location.search.substring(1));
}
</script>

But upon submission the email address is not arriving with the other form fields' data. Can anyone help?

Thank you

Jay
 
well this seems to have done the trick

var company1=unescape(ar[2]);
while(company1.indexOf("+") != -1) {
company1 = company1.replace("+", "&nbsp;");
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top