Thursday, July 7, 2011

Using Jquery dialog on confirmation

$("a[name='delete']").click(function(e){
                e.preventDefault();
                var href = $(this).attr("href");

                $( "#dialog-confirm" ).dialog({
                buttons: {
                        "Delete": function() {
                            window.location.href = href;
                        },
                        Cancel: function() {
                            $( this ).dialog( "close" );
                        }
                    }
                });

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

No comments:

Post a Comment