Advanced search Search tips
This site will be read-only for 3-4 hours starting at Sunday, 08:00AM PDT
Starred by 29 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Feb 2014
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocked on:
issue 16045

issue 17806

showModalDialog fails to return window.returnValue after being submitted from a form (asp based project)

Reported by, Apr 30 2010 Back to list

Issue description

Chrome Version       :
URLs (if applicable) : n/a
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 4: not tested
  Firefox 3.x: OK
         IE 7: OK
         IE 8: OK

For a working example of the problem, please see the attached test case,

Basically its a simple asp page with a href to a javascript function which 
calls showModalDialog(...) with a url to another asp page which contain a 
form with an editbox and submit button.

using the sample attached...

1. open the test_chrome.asp in your browser
2. click the "Lets test this showModalDialog bug" link
3. the modal window will open, enter a value into the edit box and click 

The expected result is the value entered into the editbox of the modal 
window is to be return to the parent window and displayed in an alert.

What happens instead, is the window.returnValue of the modal window, which 
was set in javascript before calling window.close() seems to be flattened 
completly and the window.returnValue is nullified when we return to the 
parent windows call to showModalDialog(...)

The strange thing in all of this is, if you do not use a form and submit 
back to the same asp page and just provide a href link which executes a 
javascript function to set the window.returnValue and call window.close() 
seems to work perfectly well, and the modal window returns the value as 
expected, this is also built into my example.

So there is something very odd going on when we use a form to submit back 
to the modal windows asp page to set the value and close the window.

All should be come clear if you try my example. Please feel free to contact 
me if you need any more details or other help.

1.7 KB Download
I have the same issue with chrome version 5.0.375.29.
I use Java/Servlet/JSP for my application.
window.returnValue is correctly returned when the page inside the modal window directly 
set the value. the return value is undefined when the page inside the modal window 
posts itself and the loaded page set the value.

Comment 2 by, Jun 10 2010

Labels: -Area-Undefined Area-WebKit OS-All
Status: Untriaged
showmodaldialog's return value doesn't seem to work at all for me. When I open chrome/test/data/showmodaldialog.html, the tab's title is set to undefined.

Comment 3 by, Jun 11 2010

Labels: Mstone-6
Status: Assigned
I know just the owner for this! :)

Comment 5 by Deleted ...@, Jul 7 2010

In postback chrome looses returnValue.
I got one workaround, by putting controls inside UpdatePanel
This issue is marked as M6. Are you sure it is? Dear owner, please update the milestone accordingly.
Labels: -Mstone-6 Mstone-7
Labels: -Mstone-7

Comment 9 by, Sep 3 2010

Labels: Mstone-8
Blockedon: 16045
The underlying issue that showModalDialog() as it is implemented currently is not modal, which means the modalWindow can't really return a value to the parent.  This issue is captured in the bug -  I marked this bug as blocked on that.
Labels: -Mstone-8 Mstone-9
Since we are passed the branch, moving all mstone-8 issues to mstone-9 for triage/punting
Labels: -Mstone-9 Mstone-10

Comment 13 by, Dec 9 2010

Labels: -Mstone-10 MovedFrom-10 Mstone-11
P2 bugs with an owner that are not marked as started are being automatically moved to mstone:11.

Comment 14 by, Mar 9 2011

Labels: -Mstone-11 MovedFrom-11 Mstone-12
rolling non releaseblocker mstone 11 bugs to mstone 12. 

Comment 15 by, Apr 25 2011

Labels: Mstone13 MovedFrom12
Moving out of M12.

Comment 16 by, Apr 25 2011

Labels: -Mstone-12 Mstone-13
Moving out of M12.
Labels: -Mstone-13 Mstone-14 MovedFrom13
Moving !type=meta|regression and !releaseblocker to next mstone
Labels: -MovedFrom12 MovedFrom-12

Comment 19 by, Jun 30 2011

Owner: ----
Status: Available

Comment 20 by Deleted ...@, Jul 7 2011

Is this issue fixed in latest chrome (worked for me in latest version 12.0.742.112)
if yes ,then why is this bug status is still 'Available'? 

No, this is not fixed yet. I tested on the version 12.0.742.112.
As explained in the bug description, window.returnValue does return a value when it is set by the javascript in the first page in the modal window, but the value is not returned when form post is used.

Comment 22 by, Jul 28 2011

Labels: -Mstone-14 Mstone-15 MovedFrom-14
Punting out non-critical bugs.  Please move back to 14 if you believe this was done in error.

Comment 23 by, Sep 8 2011

Labels: Mstone-16 MovedFrom15 bulkmove
moving non-essential bugs from 15 to 16. Please feel free to move back if this is an error and your bug is a blocker for 15.

Comment 24 by, Oct 24 2011

Labels: -Mstone-16 MovedFrom-16 Mstone-17

Comment 25 by Deleted ...@, Dec 16 2011

Same problem version 15.0.874.121 m on Windows

Comment 26 by, Dec 19 2011

Labels: -Mstone-17 MovedFrom-17
Removing milestone on all bugs marked available and targeted at m17.  Please re-triage to a new milestone if desired.

Comment 27 by, Jan 24 2012

Labels: Mstone-X

Comment 28 by, May 22 2012

There's a workaround for this issue here:

Comment 29 by, Nov 20 2012

Blockedon: -chromium:16045 chromium:16045
Blocking: -chromium:17806 chromium:17806
Labels: -Mstone-X MstoneRemoved
Bugs that have been moved 5 or more times. Removing Mstone label.

Comment 30 by, Nov 20 2012

Bugs that have been moved 5 or more times. Removing Mstone label.

Comment 31 by, Nov 20 2012

Bugs that have been moved 5 or more times. Removing Mstone label.
Project Member

Comment 32 by, Mar 10 2013

Labels: -Area-WebKit Cr-Content
Project Member

Comment 33 by, Apr 6 2013

Labels: -Cr-Content Cr-Blink
Note that this bug is not limited to postbacks. Any page load on the modal dialog will cause the same issue. This includes, but is not limited to, setting window.location.href, calling window.location.replace, and calling window.location.reload.

Comment 35 by Deleted ...@, Aug 6 2013

i solve it with update panel 

Comment 36 by, Feb 24 2014

Status: WontFix
Marking WontFix. showModalDialog is being removed. See  issue 345831 .