Sanjay Rathod
Sanjay Rathod

Reputation: 1143

Dialogue box in jQuery not working?

Here is my dialogue box code which using jQuery

    $(document).ready(function(){
       function showDialog() {
        $("#Close").dialog({
            resizable: true,
            height: 140,
            modal: true,
            position: 'center',
            buttons: {
                'Yes': function () {
                    $(this).dialog("close");
                    return true;
                },
                'No': function () {
                    $(this).dialog("close");
                    return false;
                }
            }
        });
    };

    $('#Open').click(function(){
    alert('Hellp');
    //    showDialog();
    });
});

But does is not working? Here is my jsfiddle - http://jsfiddle.net/zjRga/349/

Upvotes: 1

Views: 69

Answers (2)

Vinay
Vinay

Reputation: 325

I understand that you may need to check the tags. They are perfectly close. Hence, I would like to suggest you check the opening and closing tags. Meanwhile I have checked your code jsfiddle and make necessary adjustments.

You can check this here [http://jsfiddle.net/zjRga/353/]

Upvotes: 0

David
David

Reputation: 218877

In your code you never actually invoke the dialog. Notice this:

alert('Hellp');
//    showDialog();

You're showing a standard alert instead of calling your showDialog function. When I swap out those lines as comments in your jsFiddle, it seems to work:

//alert('Hellp');
showDialog();

Upvotes: 4

Related Questions