Connecting Tech Pros Worldwide Forums | Help | Site Map

Setting input value in parent from iframe

Newbie
 
Join Date: Oct 2006
Posts: 22
#1: Nov 16 '06
Hi, I need to change the value of a text input (onmousemove) in the parent document from an iframe, based on what an iframe variable is.

I tried this code along with several others but can't seem to get it to work:

(in the iframe)
window.parent.points.mapvalues.value = tempX;


Any help would be appreicated. Thanks....

dswethar's Avatar
Member
 
Join Date: Nov 2006
Location: UK
Posts: 68
#2: Nov 17 '06

re: Setting input value in parent from iframe


You can try this:

window.parent.[top_frame_name].document.[form_name].[text_name].value

the items in [ ] should be replaced and the [ ] should be removed.
Newbie
 
Join Date: Oct 2006
Posts: 22
#3: Nov 17 '06

re: Setting input value in parent from iframe


Thanks dswethar.

The document clause is what I was missing in my combinations.

This (slightly) shorter combo also works for me:

parent.document.formname.textname.value
dswethar's Avatar
Member
 
Join Date: Nov 2006
Location: UK
Posts: 68
#4: Nov 18 '06

re: Setting input value in parent from iframe


Did it work in firefox too? Because if its working in IE, it might not be a standard sometimes and will not work in other browsers.
Reply