【问题标题】:Submitting a form within a jquery UI dialog on iPad在 iPad 上的 jquery UI 对话框中提交表单
【发布时间】:2017-09-08 00:15:12
【问题描述】:

我有一个 jquery UI 对话框,里面有一个表单,我想在点击 OK 按钮后提交。

    function JQDialogOKCancel(title, text, width) {
    $( '#JQDialog' ).html(text);
    $( '#JQDialog' ).dialog({ 
        title: title,
        width: width,
        height: 'auto',
        buttons: {
            OK: function() {
                $( 'form' ).submit(),
                $( this ).dialog( 'close' );
            },
            Abbrechen: function() {
                $( this ).dialog( 'close' );
            }
        }
    });
}

我想你们都知道现在会发生什么。 $( 'form').submit() 不适用于 iPad。有没有简单的方法来解决这个问题?

【问题讨论】:

    标签: jquery ios forms dialog submit


    【解决方案1】:

    好的,只是为了帮助有同样问题的人在这里回答...

    我没有设法找到解决方案,所以我创建了一个没有按钮的对话框,并将“确定”和“取消”放入表单本身。 (在变量“text”中)

    为避免在点击“取消”后刷新页面,我在取消按钮上使用了 onClick,然后执行以下操作:

    $(this).closest('.ui-dialog-content').dialog('close');
    

    【讨论】:

      猜你喜欢
      • 2015-06-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多