我使用這個代碼:JQuery的AJAX提交功能添加驗證
function submitForm() {
$.ajax({type:'POST',
url: 'index.php',
data:$('#ContactForm').serialize(),
success: function(response) {
$('#ContactForm').find('.form_result').html(response);
}}
);
return false;
}
它運作良好,但我怎麼去添加例如...驗證提醒,如果用戶名或密碼是空的?
我知道這裏有很多類似的腳本,但是想特別將它添加到這個腳本中。
的例子或低於之前或Ajax調用後,應驗證呢? – anthonygore