【问题标题】:jQuery UI modal dialog form using remote content使用远程内容的 jQuery UI 模态对话框表单
【发布时间】:2010-07-26 20:08:34
【问题描述】:

我在网页中有一个动态生成的表单,我想使用 jQuery UI 模式对话框来显示它。

当我单击“打开表单”链接时,如何以远程现有表单 (myform.html) 作为内容显示模式对话框表单? 点击提交按钮应该会关闭对话框。

【问题讨论】:

    标签: javascript jquery forms jquery-ui web-applications


    【解决方案1】:

    这会将myform.html 的内容加载到ID 为formContainer 的元素中,使formContainer 成为模式对话框(显示表单)。提交表单时,对话框将关闭

    $("#formContainer").load("myform.html", function() {
        var container = $(this);
        container.dialog({
            modal: true
        })
        .find("form").submit(function() {
            container.dialog("close");
            return false;
        });
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-16
      • 1970-01-01
      • 1970-01-01
      • 2011-04-13
      • 2012-07-16
      • 2015-04-23
      相关资源
      最近更新 更多