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!

Submit Forms In Other Frames

Status
Not open for further replies.

Noonoo

Technical User
Jul 16, 2002
35
GB
Hello folks.

I'm trying to make a button in one frame which when clicked submits the contents of forms in 2 other frames.

I've got so far using a function:

function Posty() {
parent.CentreFrame.form1.submit();
parent.RightFrame.form1.submit();
}

and calling it in a form by

<form name=&quot;submit_button&quot;>
<input type=&quot;button&quot; value=&quot;submit&quot; onClick=&quot;Posty()&quot;>
</form>

This worked once but when I've tried additional submits with different contents I'm getting an error message in IE 'object does'nt support this property or method'. Apparently this problem was with the line 'parent.CentreFrame.form1.submit()'

In Netscape6 this technique does'nt work at all.

Anyone out there have any ideas. This seems like it should be possible...
 
No. It's all the same domain.

Think it's something to do with how I've put the function together.

Any ideas gratefully received though...
 
Have you tried
<form name=&quot;submit_button&quot;onsubmit=&quot;Posty()&quot;>
didn't test it
 
Just to check...
is CentreFrame misspelled?
should it be CenterFrame?
 
> This worked once but when I've tried additional submits with different contents I'm getting an error message in IE 'object does'nt support this property or method'.

So if you submit it one time it gives no errors? Then if you hit submit a second time it gives an error? Could this be because the page has changed after submitting the form and the new page has a different form name or somehing?


From the code you gave there is no error, thus it must lie in the greater picture. Could you perhaps provide an online example of it?
If you can't do that, then these questions might help:
What happens when parent.CentreFrame.form1.submit(); is submitted? Same for RightFrame - what happens?
 
Cheers for your help.

I've cracked it now though. Both forms were in turn submitting to another frame. I've added a reset of that frame in between the 2 posts in the the function and it works now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top