1 Reply Latest reply on Dec 4, 2006 3:26 AM by sfbell

    Submit a form from outside iframe

    C_Macca
      Hi i have a form displayed on a page inside a iframe

      <iframe src="SMS_MembersList.cfm" width="100%" marginwidth="10" height="332" marginheight="10"
      scrolling="auto" allowtransparency="true"></iframe>

      what i need to do is have a button that submits this form from outside the iframe

      ie

      <table>
      <tr>
      <td><a href="javascript:document.myForm.submit();">submit</a></td>
      </tr>
      <tr>
      <td>
      <iframe src="SMS_MembersList.cfm" width="100%" marginwidth="10" height="332" marginheight="10"
      scrolling="auto" allowtransparency="true"></iframe>
      </td>
      </tr>
      </table>
        • 1. Re: Submit a form from outside iframe
          sfbell
          have never tried submitting a form within an iframe but from the parent page you can call a JS function within the iframe page which could then submit the form. For example:

          parent_page_function() {
          //could be called from a button you click
          window.frames["form_iframe"].submit_page();
          }

          <iframe name="form_iframe" id="form_iframe" marginheight="0" marginwidth="0" frameborder="0" src="file_name.cfm"></iframe>

          on the iframe page have the function submit_page() with the document.all.submit etc etc.

          Hope that helps.