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

submit from a frame

New Here ,
Dec 02, 2006 Dec 02, 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

455

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
LEGEND ,
Dec 02, 2006 Dec 02, 2006

Copy link to clipboard

Copied

Try giving your iframe a name, and including that name in the anchor tag on your parent page.

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
New Here ,
Dec 02, 2006 Dec 02, 2006

Copy link to clipboard

Copied

ok thanks

so if i named my iframe "FRAME001"

would my button look like this? changing the document to FRAME001

a href="javascript:FRAME001.myForm.submit();">

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
LEGEND ,
Dec 02, 2006 Dec 02, 2006

Copy link to clipboard

Copied

Worth a shot. What happened when you tested it>

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
New Here ,
Dec 05, 2006 Dec 05, 2006

Copy link to clipboard

Copied

LATEST
The way you can reference submitting the iframe may be:

javascript:window.frames["form_iframe"].submit();

If that doesnt work you can call a function from the main page which calls a function within the iframe by the following:

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