jquery ui dialog box need to return value, when user presses button, but not working

前端 未结 5 1243
面向向阳花
面向向阳花 2020-11-29 09:32

I\'v got a jquery ui dialog box I want to use to prompt the user to confirm a deletion. When the user presses \"yes\" or \"no\" I need to return \"True\" or \"False\" to co

5条回答
  •  孤城傲影
    2020-11-29 09:53

    function confirm() {
            $("#dialog-message").dialog({
                    modal : true,
                    buttons: {
                        "Yes" : function() {
                            $(this).dialog("close");
                            document.forms[0].action = "actionname-yes";
    
                            document.forms[0].submit();                         
                        },
                        "No" : function() {
                                $(this).dialog("close");
                                document.forms[0].action = "actionname-no";
                                document.forms[0].submit();
                        }       
                    }
            });
    

提交回复
热议问题