相关疑难解决方法(0)

使用jquery ui对话框确认表单提交的操作

我在页面上有多个表单,对于每个表单,我希望用户在表单提交之前进行确认.但是当用户确认提交时,如何让这个对话框知道用户在哪个表格中进行汇总?它需要自定义参数吗?谢谢.

$("#dialog-confirm").dialog({
        resizable: false,
        height:140,
        modal: true,
        buttons: {
            'Confirm submit': function() {
                document.______???????_____.submit();
            },
            Cancel: function() {
                $(this).dialog('close');
            }
        }
    });
$('.allForms').submit(function(){
      $('#dialog-confirm').dialog('open');
});
Run Code Online (Sandbox Code Playgroud)

jquery confirm

9
推荐指数
1
解决办法
2万
查看次数

Bootstrap Modal - 如果单击 Yes 按钮,如何返回 True - 自定义确认

好的,我已经花了一整天的时间阅读问答,但仍然无法完成。我需要创建一个自定义的确认(),而不是默认对话框,如果用户单击是,我使用引导模式返回真,否则返回假。

例子:

<a href="remove.php?id=3" onclick="return custom_confirm('Are you sure you want to remove this?');" />

我的自定义确认功能是:

function custom_confirm(message) {
  //  put message into the body of modal
  $('#modal-custom-confirmation').on('show.bs.modal', function (event) {
  //  store current modal reference
    var modal = $(this);

    //  update modal body help text
    modal.find('.modal-body #modal-help-text').text(message);
  });

  //  show modal ringer custom confirmation
  $('#modal-custom-confirmation').modal('show');

  //  if Yes button is clicked, return true
  //  if No  button is clicked,  return false
  //  logic here...
}
Run Code Online (Sandbox Code Playgroud)

我的模态在这里:

<!--  modal: custom confirmation …
Run Code Online (Sandbox Code Playgroud)

javascript jquery bootstrap-modal

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

jquery ×2

bootstrap-modal ×1

confirm ×1

javascript ×1