PDA

View Full Version : if (window.showModalDialog) Not working??



tonyking
08-13-2009, 08:19 PM
I am trying to show a modal popup window with confirmation to users of my web app. Problem is I can't get it to render correctly in firefox. Can anyone help me out here? Both browsers alert that it's IE.

(I plan on using the windowVariables to center the modal's when they pop up)



function modalWin(ToolId) {
if (window.showModalDialog) {
alert('This Should be IE');
var windowWidth;
var windowHeight;
windowWidth = (window.screen.width/2) - (100 + 10);
windowHeight = (window.screen.height/2) - (75 + 50);
var myString = "asp_files/VerifyToolsToCart.aspx?ToolId=" + ToolId;
window.showModalDialog(myString,"name",
"dialogWidth:100px;dialogHeight:75px");
} else {
alert('This Should be FF');
var windowWidth;
var windowHeight;
windowWidth = (window.screen.width/2) - (100 + 10);
windowHeight = (window.screen.height/2) - (75 + 50);
var myString = "asp_files/VerifyToolsToCart.aspx?ToolId=" + ToolId;
window.open(mystring, 'name','height=75,width=100,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes');
}
}