jQuery对话框按钮文本

时间:2011-04-12 14:06:20

标签: jquery

我正在使用jQuery UI来创建一个AJAX表单。 我的表单工作正常,但按钮的文本属性由于某种原因没有显示。

这就是我正在使用的:

$( "#help_form" ).dialog({
        autoOpen: false,
        height: 300,
        width: 350,
        modal: true,
        buttons: [
            {
                text: "Send Request",
                id: "submit_help_form",
                click: function() {}
            }
        ]
    });

按钮显示在表单底部,但不显示任何文本。

有谁能看到我做错了什么?

任何建议表示赞赏。

感谢。

1 个答案:

答案 0 :(得分:1)

您的代码在这里工作,我可以看到按钮标签。你使用的是什么浏览器? 我尝试改变一些部件,它也有效:

$(function(){
    $( "#help_form" ).dialog({
        autoOpen: false,
        height: 300,
        width: 350,
        modal: true,
        buttons: {
            "Send Request":function() {alert(0);} 
            ,"Send Request2":function() {alert(2);} 
        }
    });

    $( "#help_form" ).dialog('open');
});
相关问题