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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JS encoding text when window.opener is used 1

Status
Not open for further replies.

developer155

Programmer
Jan 21, 2004
512
US
I have a pop up (asp.net page) that have JS that sends a fields value to a field on the opener page:
window.opener.document.frmLocation.OStreetAddressText.value = address;

For some reason the caller form gets the address value it looks like it has been URL-incoded. Why does that happen and how can this be fixed?

thanks!!
 
Is it not encoded before it is sent? These things don't just happen for no reason, so it must be getting encoded at some stage.

Does it look encoded on the opener form (client-side), or only when that is submitted?

Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Nope, it is not encoded in any way before it is sent to opener form. It appears encoded on opener form.
Could it be that it gets encoded by broser when it is transferred between 2 forms, popup and parent?
Also, what is the way to do URLDecode in JS?
 
Could it be that it gets encoded by broser when it is transferred between 2 forms, popup and parent?

It might be... but this is not default behaviour. Maybe you have some 3rd-party browser add-on, extension, etc, installed that is causing this.

To decode, use "unescape":

Code:
newStr = unescape(oldStr);

Hope this helps,
Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top