public knowledge blog_load(sender Virendra)

                                                                                                             Nothing shocks me, I am a Software Engineer.

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…..

2 Responses to “Firefox 3.0 supports showModalDialog()”

  1. 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

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>