By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,119 Members | 2,086 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,119 IT Pros & Developers. It's quick & easy.

"showModalDialog" does not work in firefox,

P: 3
This code works good in IE,

[HTML]function multiuser() {
document.frmOpenInteraction1.Create.disabled=true;
document.frmOpenInteraction1.hidmultiuser.value="Y es";
var r = showModalDialog('popup.htm','NEW',
'dialogWidth:400px;dialogHeight:155px;dialogLeft:2 00px;center:1;help: no; resizable: no; status: no; scroll: no;');
window.document.frmOpenInteraction1.ticket[0].checked=false;
window.document.frmOpenInteraction1.Create.disable d=false;
}

function nonmultiuser() {
document.frmOpenInteraction1.hidmultiuser.value="N o";
if(document.frmOpenInteraction1.Create.disabled) {
document.frmOpenInteraction1.Create.disabled=false ;
}
}

but, when this same code is used in firefox, it does not work. So i had to edit multiuser function. "showModalDialog" does not work in firefox.

function multiuser() {
document.frmOpenInteraction1.Create.disabled=true;
document.frmOpenInteraction1.hidmultiuser.value="Y es";
netscape.security.PrivilegeManager.enablePrivilege ('UniversalBrowserWrite');
var r = window.open('popup.htm?params='+ params +'', 'TEST', 'chrome,centerscreen,dependent=NO,dialog=YES,modal =YES,resizable=NO,scrollbars=NO,location=0,status= 0,menubar=0,toolbar=0,height='+Height+',width='+Wi dth+',left='+X+',top='+Y);
window.document.frmOpenInteraction1.ticket[0].checked=false;
window.document.frmOpenInteraction1.Create.disable d=false;
}

function nonmultiuser() {
document.frmOpenInteraction1.hidmultiuser.value="N o";
if(document.frmOpenInteraction1.Create.disabled) {
document.frmOpenInteraction1.Create.disabled=false ;
}
}

Now, the problem that i am facing is i do get the popup window when i select "yes" but, i am able to select "no" as well even though the popupwindow is enabled.

I have verified the name too, both have the same name.

<td valign="top"><input type="radio" name="ticket" value="Yes"onclick="multiuser()"></td>
<td colspan="2" class="FieldLabelRadio">No</td>
<td valign="top"><input type="radio" name="ticket" value="No"onclick="nonmultiuser()"></td>
</TD>
</TR>
</TABLE>

<div class="ExplanationText" align="center"><IMG src="images/skins/baja/required.gif" WIDTH=13pt HEIGHT=13pt BORDER=0>- Indicates a required field.</div>

<INPUT size="30" value="" name="hidmultiuser" type="hidden" id="hidmultiuser" tabindex="" /> <INPUT size="30" value="" name="hiduseroption" type="hidden" id="hiduseroption" tabindex="" />[/HTML]
Dec 11 '07 #1
Share this Question
Share on Google+
5 Replies


gits
Expert Mod 5K+
P: 5,371
hi ...

welcome to TSDN ...

your thread title is the plain truth ;) ... showModalDialog() is IE-specific and will not work with other browsers. you may create a dhtml-dialog instead that acts as a modal dialog here ...

kind regards
Dec 11 '07 #2

P: 3
Thank you gits,

I shall try out your suggestion.
Dec 12 '07 #3

gits
Expert Mod 5K+
P: 5,371
let me know in case you encounter problems with it :) ... post back in case you have more questions ...

kind regards
Dec 12 '07 #4

P: 3
I used the below code and i do not get the child window populating.
I used this information from ....
http://msconline.maconstate.edu/tutorials/JSDHTML/JSDHTML07/jsdhtml07-05.htm

Expand|Select|Wrap|Line Numbers
  1.  
  2. function multiuser()    {
  3.         document.frmOpenInteraction1.Create.disabled=true;
  4.         document.frmOpenInteraction1.hidmultiuser.value="Yes";
  5.         input type="radio" value="Show Modal" onclick='showModalDialog("popup.htm","","dialogWidth:400px; dialogHeight:225px; status:no; center:yes")'
  6.         window.document.frmOpenInteraction1.ticket[0].checked=false;
  7.         window.document.frmOpenInteraction1.Create.disabled=false;
  8.         }
  9.  
  10.  

Earlier code was
Expand|Select|Wrap|Line Numbers
  1.  
  2. function multiuser()    {
  3.         document.frmOpenInteraction1.Create.disabled=true;
  4.         document.frmOpenInteraction1.hidmultiuser.value="Yes";
  5.  
  6.         var r = window.open('popup.htm','NEW',
  7.             'dialogWidth:400px;dialogHeight:155px;dialogLeft:200px;center:1;help: no; resizable: no; status: no; scroll: no;');
  8.             window.document.frmOpenInteraction1.ticket[0].checked=false;
  9.             window.document.frmOpenInteraction1.Create.disabled=false;
  10.         }
  11.  

Well, i am still a novice, started learning on html, so please excuse if it's wrong.
Dec 12 '07 #5

gits
Expert Mod 5K+
P: 5,371
hi ...

when you want to use the window.open() method you should use it like the following way:

Expand|Select|Wrap|Line Numbers
  1. window.open(
  2.     'http://www.google.de', 
  3.     'NEW', 
  4.     'height=155px,width=200px,menubar=no,location=no,' + 
  5.     'resizable=no,scrollbars=no,status=no'
  6. );
  7.  
kind regards
Dec 12 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.