JQuery对话框作为输入

JQuery对话框作为输入,jquery,input,Jquery,Input,我不太习惯使用jquery对话框之类的东西。 所以这是一个新手问题 此时,我正在使用提示符从SharePoint中的用户处获取回复 var answer = dialog("Type the text you want to display in the email."); 但我的投入是有限的 有人能帮我吗 增加。 我现在可以插入对话框了。但我不能展示它 我是这样插入它的: if ($("#dialogSendMail").length) { } else { $("#DeltaPl

我不太习惯使用jquery对话框之类的东西。 所以这是一个新手问题

此时,我正在使用提示符从SharePoint中的用户处获取回复

var answer = dialog("Type the text you want to display in the email.");
但我的投入是有限的

有人能帮我吗

增加。 我现在可以插入对话框了。但我不能展示它

我是这样插入它的:

if ($("#dialogSendMail").length) {

}
else {
    $("#DeltaPlaceHolderUtilityContent").after("<div id='dialogSendMail' title='Enter mail body'> <label for='mailBody'>Type the text you want to display in the email:</label><p><input type='text' id='mailBody' name='mailBody'></p></div>");
}
但是当我运行代码时,它不会显示对话框。 此外,我还试图找到一种从文本框中获取响应的方法


有人能帮我吗?

纯jquery没有这样的对话框,请改用jquery UI。 你真正的问题是什么

$( "form" ).dialog({
    open: function() {
        // On open, hide the original submit button
        $( this ).find( "[type=submit]" ).hide();
    },
    buttons: [
        {
            text: "Find",
            click: $.noop,
            type: "submit",
            form: "myForm" 
        },
        {
            text: "Close",
            click: function() {
                $( this ).dialog( "close" );
            }
        }
    ]
});

提琴:德扬。学生:显示我的答案不是问题。我能做到。您的代码看起来不错,但在您的代码中,js和html都在html窗口中,我认为这是更好的方式:
$( "form" ).dialog({
    open: function() {
        // On open, hide the original submit button
        $( this ).find( "[type=submit]" ).hide();
    },
    buttons: [
        {
            text: "Find",
            click: $.noop,
            type: "submit",
            form: "myForm" 
        },
        {
            text: "Close",
            click: function() {
                $( this ).dialog( "close" );
            }
        }
    ]
});