I’m having multiple iframes in one page each one contains a form , and i put the submit button outside the iframes , and when user press on submit all forms should be submited and then the page should be closed , any one can help me in this?
this function called onclick on submit button
function Save_Close()
{
if (window.frames.intake_pat_info_iframe && window.frames.intake_pat_info_iframe._Submit('Update')) {
window.frames.intake_pat_info_iframe._Submit('Update');
}
if (window.frames.intake_job_info_iframe && window.frames.intake_job_info_iframe._Submit('Update')) {
window.frames.intake_job_info_iframe._Submit('Update');
}
if (window.frames.intake_spine_his_iframe && window.frames.intake_spine_his_iframe._Submit('Update')) {
window.frames.intake_spine_his_iframe._Submit('Update');
}
if (window.frames.intake_past_med_history_iframe && window.frames.intake_past_med_history_iframe._Submit('Update')) {
window.frames.intake_past_med_history_iframe._Submit('Update');
}
….
<input type="button" id="" name="" value="Save & Close" onclick="Save_Close()"/>
thnx
As long as you can use Javascript and your iframes are all being served from the same server, it’s not that hard. A completely pure inline JS approach looks like (this is using ASP.NET for the server-side stuff but the important bit is the onclick() handler in the button)
EDIT: now explicitly calls form.submitButton.click() instead of form.submit() to invoke functions bound to submit button’s Click handler.