简体   繁体   English

提交表单 - 提交后缓存

[英]Submit form - cach after submited

I am trying to post the form from modal.我正在尝试从模态发布表单。 To keep the current page, I target post to the iFrame.为了保留当前页面,我将帖子定位到 iFrame。

Which trigger is triggered after posting the form?发布表单后触发哪个触发器? Or any other solution to close modal after post?或者在发布后关闭模式的任何其他解决方案? OnSubmit, as seen in the code, do not work.如代码中所示,OnSubmit 不起作用。

        <div class="modal-body">
            <form method="post" id="modalForm" action="/Test/TestForm" target="myframe">
                <input type="text" name="id" required />
                <input type="text" name="name" required />
                <input type="submit" value="Post" onsubmit="alert('after post - close modal!');" />
            </form>
        </div>

You can post form via Ajax and get the begin and end request by using the following approach:您可以通过Ajax发布表单,并使用以下方法获取开始和结束请求:

<script> 
    $(document).ajaxStart(function () {
        //display loading, etc.
    });

    $(document).ajaxComplete(function () {
        //hide loading, etc.
    });        
</script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在表单验证并由ajax提交后,如何禁用或隐藏“提交”按钮? - How to disable or hide submit button after form validate and submited by ajax? 使用onchange = this.form.submit()传递提交表单的标签的ID - Passing id of tag that submited form with onchange=this.form.submit() jQuery验证后未提交表单 - form not been submited after jquery validation jQuery的步骤:提交表单时禁用提交按钮 - jquery-steps : disable submit button when form are submited 仅当通过提交按钮以表单提交数据时,才启用对话框 - Enable Dialogbox only when data submited in a form through submit button React redux 提交并使用下一页提交的数据表单 - React redux submit and use data form submited in the next page 在ajax调用后甚至在preventDefault()之后提交表单 - Form being submited even after preventDefault() after ajax call 提交表单后,jQuery运行代码并向控制台显示结果 - Jquery run code and show results to console after form is submited JSF提交按钮 - 表单在一秒钟内被提交X次(直到视图重新创建) - 如何防止它? - JSF submit button - form is X times submited during one second (until view recreated) - how to prevent it? 一键提交多个表单(动态创建),每个表单可以单独提交 - Submit multiple forms (dynamicly created) with one button, each form can be submited individually
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM