Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

write from child form to parent form

Status
Not open for further replies.

techskool

Technical User
Jun 20, 2002
151
GB
Hi Guys.

I have a html form which is on a job logging system.

I am trying to get it it to fill out a persons details from values it already has in a db.

Heres where I am up to; a form with a user id field is filled out with a username and you click a link that pops up a pop up window which then has a form on it that contains stuff like name and job title etc.

I get it to the point where a lookup is performed on a unique user id and matching details are returned to the pop up, but i then want the values on the form in the pop up copied back to the parent form, so name and job title etc are filed out, when you click a link / button in the pop up.

Im unsure what code to use on the onclick event that would actually take child values back to parent.


all help as always greatly appreciated

dave

:)

 

You can access the opener using "window.opener", so you would use probably this to set the value of form fields in the parent:

Code:
window.opener.document.forms['formName'].formElementName.value;

Hope this helps,
Dan
 
Thanks for the response.

Thats similar to what I had but i must be using it incorecctly on the event.

Am I right puting a dead link ' a href="#" ' and then the ' onclick ="window.opener etc.. ;self.close()" '

I cant seem to get it to do anything?

Thanks again

Dave
 
you can directly use
<a href='javascript:window.opener etc.. ;self.close()'>..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top