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

Getting secondary frame to submit

Status
Not open for further replies.

geuis

Programmer
Jan 26, 2003
7
US
I am in a situation where I have a single page divided into 2 frames. I have a <input type=&quot;button&quot; value=&quot;Next&quot;> that is located on the 2nd frame. What I need to do is be able to click on Next, have it call a javascript function that will get the 1st frame to do a submit. I have code where I can do this from the same document with a form using JS code document.form[0].submit. I need to do something similar to this but have the .submit triggered from javascript so that it will work from the button stored in a separate document. Thanks!
 
In the button tag place:

onclick='parent.frames[0].document.forms[0].submit();'

Try that. ASCII silly question, get a silly ANSI
 
I tried that code and now I get a debug error in IE 'Access denied.' I checked the code of the pages that will fill frame2 and found there are no forms, so the forms[0] portion of the code is not gonna work.
I even tried onclick='parent.frames[0].document.submit();' but got the same error. Also tried changing the frames[] # but still no success.
 
try using the name of the childFrame...

onclick='parent.childFrameName.document.formName.submit();'
Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048

mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top