I have jsp file – Main.jsp as my parent window. I have pop-up window (child) to open new window . My probs is how i am going to pass variables (textfield,select,etc data) to my child window?
@CrazyMerlinJan 18.2006 — #you have a misconception here, one that many people have.
you do not 'pass' data to a child window, the child window 'gets' data from it's parent
think about it that way, and it's much clearer.
to get data from a parent window, you use: [CODE] window.opener.document.getElementById('targetname') [/CODE] where targetname is the name of the value you want
example:
lets say you have a new child window with a textbox that has an id of childText, and you also have a textbox on your parent document that has an id of parentText
when you create your child window, you want the textbox on child to be the same as the textbox on parent
this would be your code in the child document [CODE] <script> document.getElementById('childText').value = window.opener.document.getElementById('parentText').value; <script> [/CODE]