【问题标题】:jquery cancel button text change.I required "NO" instead of "Cancel"jquery取消按钮文本更改。我需要“NO”而不是“Cancel”
【发布时间】:2014-11-26 07:01:37
【问题描述】:
  $("#dvdialogconfirm").text(msg);
        $("#dvdialogconfirm").dialog({
            resizable: false,
            modal: true,
            zIndex: 100001,
            closeOnEscape: false,
            width: 360,
            buttons: {
                OK: function () {
                    $(this).dialog("close");
                    if (func != null) {
                        func();
                    }
                },
                Cancel:
                    function () {
                    func1();
                }
            }
        });

【问题讨论】:

  • 只需将取消更改为“否”

标签: jquery dialog


【解决方案1】:
$("#dvdialogconfirm").text(msg); 
  $("#dvdialogconfirm").dialog({ 
     resizable: false, 
     modal: true, 
     zIndex: 100001, 
     closeOnEscape: false, 
     width: 360, 
     buttons: { 
        YES: function () { 
                $(this).dialog("close"); 
                if (func != null) {
                    func(); 
                 } 
             }, 
        NO: function () { 
             func1(); 
            } 
     } 
  });

我认为这个对你有帮助。

【讨论】:

  • 感谢您的支持。一切正常。
【解决方案2】:

您可以根据需要通过更改对象来更改按钮文本。假设您希望它是“是”或“否”对话框,那么:

$("#dvdialogconfirm").text(msg);
        $("#dvdialogconfirm").dialog({
            resizable: false,
            modal: true,
            zIndex: 100001,
            closeOnEscape: false,
            width: 360,
            buttons: {
                Yes: function () {
                    $(this).dialog("close");
                    if (func != null) {
                        func();
                    }
                },
                No:
                    function () {
                    func1();
                }
            }
        });

【讨论】:

  • 感谢您的支持。一切正常。
猜你喜欢
  • 2016-01-27
  • 2012-05-24
  • 2011-11-12
  • 1970-01-01
  • 1970-01-01
  • 2011-04-29
  • 1970-01-01
  • 2017-12-12
  • 2012-11-20
相关资源
最近更新 更多