Firefox 3.0 supports showModalDialog()
Posted by Virendra Dugar on January 6, 2009
As we all know that Javascript function window.showModalDialog() creates a modal dialog box that displays the specified HTML document.A modal dialog box retains the input focus while open. The user cannot switch windows until the dialog box is closed.
This works fine in Internet explorer 4.0 and later version of IE.
showModalDialog was not supported in version launched before firefox 3.0.
But in the latest version of firefox (firefox 3.0) it is supported.
Check out this link..
Test this page in Firefox 2 and Firefox 3
Chrome (Google’s new browser) also supports showModalDialog().
Enjoy…..
RSS - Posts
Deeksha said
Hi,
Thank you. I have another question. I have 2 pages,1st page calls the 2nd page which is modalpopup. In the modal popup I have difficulties with the window.return value. My code goes like this in the modalpage.
function fu()
{
var a = document.getElementById(‘retval’).value;
window.returnValue = a;//
window.close();
}
code behind:
protected void Button1_Click(object sender, EventArgs e)
{
var cid = this.ClientID;
ClientScript.RegisterStartupScript(GetType(), “myscript”, ” fu(); “, true);
}
This doesnt work. But if I have another button like save:
If javascript fu() is called directly on the page itself like onclick=fu(), it works, but when it is called from the code behind its not working. I need the code behind implementation since my company has some specifications.
Thank you
Virendra Dugar said
Hi deeksha,
Your code looks correct to me. and I tried on my end and it is working.
So may be you are doing some other mistake. Check again..