• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Submit a form from outside iframe

New Here ,
Nov 29, 2006 Nov 29, 2006

Copy link to clipboard

Copied

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>
TOPICS
Advanced techniques

Views

804

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 04, 2006 Dec 04, 2006

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation