lt. surge
lt. surge

Reputation: 11

jQuery UI dialog box not opening?

I want the dialog box to open when the user clicks on the delete button (input type="submit"), but nothing happens, not even a JS error.

Code :

$(function() {  

$( "#dialog-confirm" ).dialog({
        autoOpen: false,
        resizable: true,
        modal: true,
        overlay: {
            backgroundColor: '#000',
            opacity: 0.5
        },
        buttons: {
            "Delete": function() {

                    $.ajax({
                        type: "post",
                        url: "delete.php",
                        data: "eridTBD=" + eridTBD,
                        context: $( "h1" ).first(),

                        error: function(){

                            $( this ).after( "<p>no dice</p>" );

                        },

                        success: function( results ){

                            $( this ).after( results )

                        }               
                    });

                    $( this ).dialog("close");
            },

            Cancel: function() {
                $( this ).dialog("close");
            }
        }
});


$( ".delete_form input[name=delete]" ).click(function() {

        $( "dialog-confirm" ).dialog( "open" );
        return false;
});

});

Any suggestions?

Upvotes: 0

Views: 1835

Answers (1)

SeanCannon
SeanCannon

Reputation: 77956

Missed the pound sign:

$( "dialog-confirm" ).dialog( "open" );

should be

$( "#dialog-confirm" ).dialog( "open" );

Upvotes: 1

Related Questions