Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 单击保存按钮后关闭ModalPopup jquery_Php_Javascript_Jquery_Ajax_Codeigniter - Fatal编程技术网

Php 单击保存按钮后关闭ModalPopup jquery

Php 单击保存按钮后关闭ModalPopup jquery,php,javascript,jquery,ajax,codeigniter,Php,Javascript,Jquery,Ajax,Codeigniter,我正在开发一个代码点火器。在我的查看页面中,我有一个模式弹出窗口。在modalpopup中,我放置了form.so,我想要的是当用户单击save按钮时,模型会通过jquery弹出 这是我的保存和关闭按钮。。。如果我单击close按钮,模型会很好地关闭,但是因为对于save按钮,我已经将控制权交给了jquery,所以我想在那里关闭,我不知道 <a href="#" class="btn" data-dismiss="modal">Close</a> <

我正在开发一个代码点火器。在我的查看页面中,我有一个模式弹出窗口。在modalpopup中,我放置了form.so,我想要的是当用户单击save按钮时,模型会通过jquery弹出

这是我的保存和关闭按钮。。。如果我单击close按钮,模型会很好地关闭,但是因为对于save按钮,我已经将控制权交给了jquery,所以我想在那里关闭,我不知道

    <a href="#" class="btn" data-dismiss="modal">Close</a> 
   <a id = "save" class="btn x" data-dismiss="modal">Save changes</a>



   <script type="text/javascript">
    $('#save').click(function() { //  $("#form").serialize()

var check_no = $('#check_no').val();
var form_data = {
        check_no: $('#check_no').val(),


};



$.ajax({
    url: "<?php echo site_url('checkDetailsController/addCheckDetails'); ?>",
    type: 'POST',
    data: form_data,
    dataType: 'json',
    success: function(msg) {
        if(msg.res == 1)
        {
            alert('true')

        }
        else{
            alert("false");          
          }


    }
});

return false;
     });


  </script>

保存更改
$(“#保存”)。单击(函数(){/$(“#形式”)。序列化()
var check_no=$('#check_no').val();
变量形式_数据={
支票号码:$('#支票号码').val(),
};
$.ajax({
url:“”,
键入:“POST”,
数据:表格数据,
数据类型:“json”,
成功:功能(msg){
如果(msg.res==1)
{
警报('true')
}
否则{
警告(“假”);
}
}
});
返回false;
});

如果使用jqueryUI中的对话框,则可以使用按钮选项

$('#yourcontainer').dialog({
        buttons : {
            // Save and close button
            'Save' : function () {
                // your javascript code for saving
                $(this).dialog('close');
            },
            // Cancel button
            'Close' : function () {
                $(this).dialog('close');
            }
        },
        // and your other settings
    });

保存函数必须使用$('#dialog').dialog(“close”);而不是$(this).dialog('close')。这会导致调用附加到对话框对象的close方法。

我可以通过data Disclose关闭按钮。那么,在jquery中单击save按钮后,如何添加data Disclose