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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can a child window call form.submit() in parent window?

Status
Not open for further replies.

KevinCO

Programmer
Oct 2, 2001
45
US
Hey, thanks for reading my post. I have a Main web page that I have a link, and when you click that, a pop up window with some input options comes up. I want to be able to call a js function defined in the parent web page in the child page and pass some data from the child within the function call and submit the form on the parent page. Is this possible?
 
Sure it's possible. Just use window.opener.document.formname.fieldname.value for the parent window's fields, and window.opener.document.formname.submit() to submit the parent window's form. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Can I do reverse?
I have a window. And then, I open a new window. I would like to fill in some data in the child form.

Are there
window.child.document.formname.fieldname.value = "tested data" exist?

Best Regards,

Lawrence
 
Just keep the reference (handle) to the child window in a variable.

E.g.

Code:
var winhandle = window.open(--enter parameters here--);
winhandle.document.formname.fieldname.value = "tested data";
It's not a lie if YOU believe it ;-)
 
Hi drgenius,
It come out error.
Actually, I try to store username and password in some places. And then I try to pass the username and password to web site (fill in the "username" & "password" field in web site).

For some simple login web site, I can put "
There are some web site, such as internet banking, they have session ID. So that I cannot use url with parameters.

So that I try to launch the target web site, and then fill the username & password.

Please help.



It is the Tek-tips login, I want to fill in Handle & Password.
-----------------------------------------
<FORM NAME=&quot;pass&quot; ACTION=&quot;passcheck.cfm&quot; method=&quot;post&quot;>
<input type=&quot;hidden&quot; name=&quot;t&quot; value=&quot;&quot;>
<input type=&quot;hidden&quot; name=&quot;last&quot; value=&quot;&quot;>
<input type=&quot;text&quot; name=&quot;Handle&quot; size=8 maxlength=20><br>
<input type=&quot;Password&quot; name=&quot;Pass&quot; size=8 maxlength=20><br>PASSWORD<br>
</form>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top