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

pass hidden field from iframe to parent and vice versa 1

Status
Not open for further replies.

y2k1981

Programmer
Aug 2, 2002
773
IE
I want to create a hidden field in my main page and pass the value to an iframe. Also, i need to be able to pass the value back from the iframe to the pain page. however, I can't use the URL as these are PHP pages, I want to write something in the iframe page that will actually set the value of the hidden field in the page page, not just pass it via the URL. I'm sure this is possible as I've seen it done. can anybody help at all?
 
From parent to iframe:

document.frames["iframeName"].document.iframeFormName.iframeFieldName.value = val;

From iframe to parent:

parent.document.parentFormName.parentFieldName.value = val;

'hope that helps.

--Dave
 
Yeah, I knew the first one was something like that (been a while since I've used JavaScript), but couldn't figure out how to pass it back to the iframe. thanks again for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top