![](/img/trans.png)
[英]How can I submit a form in a parent window using jQuery without refreshing the contents of the parent window (Ajax submission)
[英]I have prevented form submission using jquery. How Can I submit form again without removing my current code?
我已經使用 jquery 阻止了表單提交。 如何在不刪除當前代碼的情況下再次提交表單?
$(".form-horizontal").submit(function (e) {
e.preventDefault();
});
使用 Js
$('.form-horizontal').get(0).submit()
或使用標志
var preventForm = true;
$(".form-horizontal").submit(function(e) {
if (preventForm) {
e.preventDefault();
}
});
在提交之前設置preventForm = false
沒有進一步的上下文很難回答,但您可以向提交按鈕添加一個單擊處理程序,該按鈕將 http 請求發送到表單端點。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.