3 回答

TA貢獻1982條經(jīng)驗 獲得超2個贊
在表單的操作參數(shù)中設置正確的文件。
在 if 條件中,寫e.currentTarget.submit();
if(name === true & subject_name === true){ e.currentTarget.submit(); }

TA貢獻1809條經(jīng)驗 獲得超8個贊
當您需要 POST 時,您的位置更改會執(zhí)行 GET
改成
$('#login').submit(function(e){
e.preventDefault();
let name = validate_name('rollno','rerror');
let subject_name = validate_select('subject_dropdown','serror');
if(name === true & subject_name === true){
$.post('controller/indexPage_logic.php', {name:rollno}, function(response) { console.log(response)}); // do what you need to do when valid on the server too
}
})

TA貢獻1765條經(jīng)驗 獲得超5個贊
您必須將您的數(shù)據(jù)發(fā)送到服務器,問題是 window.location 沒有向服務器發(fā)送任何請求以便能夠協(xié)助使用
$.post('url to the server', { data1 : "Your data", data2 : yourvar }, function(res) {
console.log(res)
});
- 3 回答
- 0 關(guān)注
- 154 瀏覽
添加回答
舉報