PDA

View Full Version : Setting Form Element Value on different page?


jwoods7
07-12-2002, 06:47 PM
I know that you can use this example syntax to set the value of a text box, radio or other form element:
document.myform.theelement.value = "Whatever..."

But is it possible to do this on another page without reloading the page?


Here is why I ask:
I want a visitor to click on a link to open a pop-up window. Within the window will have various choices. When the form on the pop-up window is submitted, that window closes and sends the value of whatever is selected to a form element on the opening page...the trick being not reloading the main page:

Any suggestions? Thanks in advance for the help!

ShriekForth
07-12-2002, 07:28 PM
Use opener

opener.document.formName.elementName.value

Script the submit button in the opened/child window to copy it's values to the opener window. You will have to do this one by one, but if it's not a big form, it's not a big deal.

I just posted an example of one here http://www.codingforums.com/showthread.php?s=&threadid=1859 that one is just a little more complicated as it generates the content of the child.

ShriekForth