faqts : Computers : Programming : Languages : JavaScript : Windows

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

33 of 77 people (43%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

Can I submit a form from a modal dialog back to the opening window?

May 18th, 2002 21:16
Daniel LaLiberte, Chris Durkin, Martin Honnen,


In IE4+ you can use
   var returnValue = showModalDialog('url')
to open a modal dialog. It seems however that you can't submit a form 
back to the opening window which makes some sense as that is in a 
frozen state expecting the result of the modal window.
So setting
  window.name = 'windowName'
in the opening window and then using
  <FORM TARGET="windowName" ...>
in the modal dialog window DOES NOT work. I don't think there is a 
workaround, other than not using a modal dialog.
A possible workaround is to arrange to close the modal dialog window, 
thus releasing the thread holding the window open.  e.g.
  <FORM TARGET="windowName" onSubmit="window.close()" ...>
For an example of how to do this using a non modal pop-up window, see 
the following link:
http://www.faqts.com/knowledge-base/view.phtml/aid/2534/fid/129/lang/en