1

well i'm back... i'm trying to make jquery UI's button and dialog plugins work with my form. i want the reset button

<button id="opener" value="reset" type="submit">Reset</button>

to pull up a confirmation dialog, which it does. cancel should dismiss dialog and set the button back to its original state. it dismisses fine but the button maintains its hover state, even though i have tried adding the .refresh method just about everywhere i can think of.

jQuery(document).ready(function($) {

$(".dialog").dialog({
            autoOpen: false,
            resizable: false,
            modal: true,
            title: 'Warning!',
            close: function () {
                $('#opener').button('refresh');
                },
            buttons: {
                'Continue': function() {
                    $(this).dialog('close');    
                },
                Cancel: function() {
                    $(this).dialog('close');
                    $('#opener').button('refresh')
                }
            }
        });


$('#opener').click(function() {
            $('.dialog').dialog('open');
            $(this).button('refresh')
            return false;
        });
});

then on a Continue response the button should continue with its original purpose.. which doesn't happen. i get a return: false type of behavior w/o return: false anywhere.

1 Answer 1

1

someone at the jquery forum answered me that for the first part i need to add

close: function () {
$('#opener').removeClass('ui-state-focus');
},

to the dialog commands. and

$('#myform').submit();

to the the continue function

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.