|
|
 |
RE: FN-FORUM: Javascript PopUp Retrieve Data From Frame
date posted 1st May 2003 14:41
Just trying to remember how I've done this in the past.... I'm pretty sure
you can do this by an onsubmit or an onclick event in the main frame that
opens the new window, then sets the forms action to the page you want to
appear in the new window, the forms target to be the windows name, in your
case "pop" and then finally does the form.submit();.
Hope this helps
Craig
-----Original Message-----
From: [EMAIL REMOVED] [EMAIL REMOVED]
Behalf Of Adrian Portsmouth
Sent: 01 May 2003 11:21
To: FN-FORUM / [EMAIL REMOVED]
Subject: FN-FORUM: Javascript PopUp Retrieve Data From Frame
Morning All,
I'm having a wee problem trying to grab some form data submitted from a
frame to a pop up using Javascript. The form is sat in the mainFrame of
the set and is submitted via an onclick event to a javascript function,
which checks the fields and then calls:
window.open('submit.htm','pop','width=350,height=100,status=yes');
In the submit.htm file I am trying to reassign the data like so:
var oform = window.opener.parent.frames['mainFrame'].form.elements;
document.form.elements["Name"].value = oform["Name"].value;
document.form.elements["CompanyName"].value =
oform["CompanyName"].value;
document.form.elements["Address1"].value = oform["Address1"].value;
But it just don't wanna happen, I have tried a few variations of:
var oform = window.opener.parent.frames[i].form.elements;
var oform = window.opener.parent.form.elements;
And nothing, anyone know what I am missing here?
Cheers
Ade
www.phpscriptsearch.com
==========
Graduate & Professional Financial Services - Specialists in MORTGAGES for
FREELANCERS. House purchase, re-mortgage (including debt consolidation and
capital raising), Buy to Let, flexible offset and current account mortgages.
Visit our website at http://www.gradprof.co.uk?fnet
To advertise here: http://www.freelancers.net/advertising.html
|
 |
|