我'嘗試AJAX提交一個表單控制器功能,然後將其重定向到包含成功列表頁面後,因爲我'使用jQuery驗證插件,我不得不AJAX提交這樣如何使用jQuery驗證插件使用Ajax提交表單並重定向到另一個頁面成功
submitHandler: function (form) {
$.ajax({
type: "POST",
url: "/admin/student/addstud",
data: $('#sturegister').serialize(),
//dataType: "html",
success: function (response) {
window.location.replace('/admin/student/add');
}
});
的細節被添加到數據庫,但形式並不重定向到/admin/student/add.is有任何其他的方式做到這一點?謝謝。
如果您想重定向,使用'.ajax()'幾乎沒有任何意義。只需使用'
謝謝,你能不能幫我解決我在這個鏈接中的問題[myanotherquestion](http://stackoverflow.com/questions/21699709/combining-custom-error-placement-with-success-is-not-working-jquery -validate-plu) –