Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Aug 2006
    Location
    Illinois
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer How to Submit Parent Form From Within iFrame

    I've seen lots of related posts about this but they so far haven't solved my problem...

    I have a parent page with one long form on it. Inside the parent form is an iframe with a form of its own. The iframe form is housed under another application and has to do its own processing (which I'm not concerned about) and then it needs to submit the parent form. My question is, how do I get the iframe form to submit the parent form?? I've tried a couple different options which don't work:

    parent.frameName.document.parentForm.submit();
    document.getElementById("iframe").contentWindow.document.parentForm.submit();

    Any other ideas?
    Thanks!
    Sarah

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    try it without the document:

    parent.frameName.formName.submit();

    Also: Is there an error message you get?

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New Coder
    Join Date
    Aug 2006
    Location
    Illinois
    Posts
    68
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Eric,
    Thanks for the quick reply! Your suggestion didn't QUITE work, but I modified a bit to get it to work:

    parent.formName.submit();

    The form submits reaaaaally slowly, so I suspect I have some other issues going on, but at least it's submitting now!

    Thanks again.
    Sarah

  • #4
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    Oh crap, I thought you said your submitting the iframe...yep removing the framename will submit the parent. LOL

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •