PDA

View Full Version : Resolved Parent form submit from modal window



perl_geek
11-03-2011, 04:13 PM
1) Script Title: Modal.js (????)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/dhtmlmodal.htm

3) Describe problem: Can anyone tell me a way to submit the parent form from a Modal window? The modal window is implemented as an iframe. I can update form fields in the parent from the modal window (parent.document.getElementById("parent form item").value = value;) but i can't submit the form. I've tried parent.document.submit(); but this gives a 'Object doesn't support this property or method' error.

Thanks, PG

(Apologies if i'm hogging the forum a bit lately)

perl_geek
11-04-2011, 08:29 AM
parent.document.forms[0].submit();

perl_geek
11-18-2011, 12:22 PM
The resolution answer i posted (parent.document.forms[0].submit();) works fine for modal windows opened using an iframe. However, i haven't been able to find anything that will provide the same functionality (submit parent window/frame from pop-up modal window) when the modal pop-up window is opened using a DIV. Would anyone be able to suggest a solution?

Thanks, PG