Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Web-Development
Hi
 
Following code is working fine in following browser:
  • IF
  • Mozilla
  • Safari
but it is not working in
  • Google Chrome 5.0.3
var returnValue = window.showModalDialog("popup.aspx?", "window", "dialogWidth:390px;dialogHeight:180px;scroll:no;");
    }
 
Your answer will be appreciated!
 
Thanks,
Imdadhusen
Posted 20-Sep-10 22:39pm
Comments
Svetlin Panayotov at 21-Sep-10 7:15am
   
Sadly, yes. Last time I tried using showModalDialog it worked in Chrome, but the same way window.open works - the window was not modal. It won't work in Opera as well, so the only thing that comes to mind is using Jquery UI's Dialog.
sukanta kumar mangal at 8-Jan-14 3:56am
   
yes i have also tried it in one of my project .it will work..
Sandeep Mewara at 21-Sep-10 13:41pm
   
Try jQuery dialogs...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I found Google has (had) some issues with the showModalDialog. You can follow the status of the problem right here[^].
 
Good luck!
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi,
 
window.showModalDialog() is not working properly on Google Chrome, this is why you have 3 options here:
1) Put onblur="this.focus()" in the body element of the target page and put a div which will prevent user from clicking on the opener page
2) Use Modal Dialog from jQuery, I have implemented a jQuery function which will give you the possibility to pass arguments to the target page, to close the dialog using window.close() and to return retunrValue
My Article: http://extremedev.blogspot.com/2011/03/windowshowmodaldialog-cross-browser-new.html[^]
3) Do not use Chrome, which I think that is not the best solution.
 
Good luck!
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

i do it one of my project .it will work .i think theire might be some issue..try again
 
window.showModalDialog("popup.aspx?", true, 'dialogHeight:150px;dialogWidth:500px');
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.140926.1 | Last Updated 8 Jan 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100