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

submitting a form from another frame

Status
Not open for further replies.

bardley

Programmer
May 8, 2001
121
US
I have a form in one frame and am trying to use a function from another frame to call the form's submit() method, but I can't seem to make it work. Something like this:
Code:
(formpage)
<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;formpage&quot;>
.
.
</form>

(otherpage)
<head>
  <script type=&quot;text/javascript&quot;>
    function submit_other_form () {
        formpage.document.form1.submit();
    }
  </script>
</head>
<body>
  <a href=&quot;javascript: submit_other_form&quot;>Submit</a>
</body>

Everytime I try the link, though, IE pops up a nasty red box saying that the method is not supported. Has anyone done this before, or know what I'm doing wrong?

Brad Gunsalus
bardley90@hotmail.com
 
oops, i meant

<a href=&quot;javascript: submit_other_form()&quot;>

:)

Brad Gunsalus
bardley90@hotmail.com
 
You've got to go up and then come down again. Use 'parent' to go up and then the line you're using. Try:

parent.formpage.document.form1.submit();

If I understand your description, that ought to do it.

Good luck.

--Dave
 
Code:
  <script type=&quot;text/javascript&quot;>
    function submit_other_form () {
        window.top.frames(&quot;formpage&quot;).document.form1.submit();
    }
  </script>


-pete
 
oops, left that out too. I was already doing that. Thanks, though.

Any other ideas???

Brad Gunsalus
bardley90@hotmail.com
 
>> oops, left that out too. I was already doing that.

If your posts are not accurate it is not possible to help you.

-pete
 
yeah, thanks pete, but your answer didn't help either.

Brad Gunsalus
bardley90@hotmail.com
 
Can you show us your FRAMESET and FRAME HTML?

--D
 
window.top.frames(&quot;[red]nameOfMyFrameWithTheForm[/red]&quot;).document.form1.submit();


-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top