tags:

views:

29

answers:

2

Hi I have a web page that opens up from another page after the user clicks a link. What i want to do using JS is reference the form data from the original page and use it on the page that has just been opened . my first page contains something like

 function date_change() {
  window.open("//www.abbeysoft.co.uk/adi/datepicker.php");
 } 

Then i want to use something like the code below in page two

 nam = document.form1.name.value

is this something I can do easily

Any hints or pointers would be great

thanks

+1  A: 

With opener

David Dorward
+1  A: 

window.opener.document.forms["form1"].elements["fieldname"].value will get you to the value of any object in a given form.

Joel Alejandro
Not a standard, does it work anywhere but Gecko?
bmargulies
Well, as far as I'm concerned, `forms` is standard. You can always add an id to the form elements and use `document.getElementById()` instead.
Joel Alejandro