|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am trying to figure how I can transfer data from a form located in one window to a form located in another window. Both windows are already open. The first window contains the form named 'form1' with the values filled in. A new window named 'second_window' is opened and on it is an HTML page with an empty form named 'form2'. The text input element named 'your_name' in form 'form1' is filled with the value 'John Doe'. I need to get that value in 'your_name' on 'form1' to the text input element in 'form2' named 'realName'.
How could I go about accomplishing the above? I have been searching the internet on how to do this for weeks but have not found anything that explains it. Any help would be appreciated. Thanks! |
|
#2
|
||||
|
||||
|
Are both windows children of a main window?
Or is one window a child of the other? |
|
#3
|
|||
|
|||
|
The first window is a parent and the other is a child. The first window has an <a href> link with target="NewFormWindow".
|
|
#4
|
|||
|
|||
|
Hey Mate!. Javascript is not really my line of work, so this is only a desperate intent to help you. If the second window is a child of the first, you can address the second window realName field from inside the first window as follows: SWindow.document.form2.realName.value
So, you could do: Swindow = window.open(<page with form2>) SWindow.document.form2.realName.value = document.form1.your_name.value I'm not so sure about SWindow.document. Perhaps it is SWindow.form2 directly. Anyway, I think this should work. If not, sorry. Good Luck Anibal. |
|
#5
|
||||
|
||||
|
You might want to look into the solution I presented in this thread:
http://forums.devarticles.com/showp...124&postcount=2 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Copy values from one form to another in different window |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|