[英]JQuery validation “remote” method response waiting message
我正在使用JQuery驗證插件“遠程”方法進行基於Ajax的驗證。
但是我必須打一些第三方電話來驗證數據,這大約需要花費時間。 30秒。
因此需要在Ajax請求處理數據時向最終用戶顯示一些消息。 誰能幫助實現這一目標?
您可以從下面看到我完成的示例:
jQuery驗證(遠程方法):
$("#myform").validate({
rules: {
email: {
required: true,
email: true,
remote: {
url: 'your-url-or-path-here.php',
cache: false,
dataType: 'POST', // Post, Get, Json, etc
data: {
field: $('.element').val()
}
beforeSend: function () {
$('.loading').css('display','none').show();
},
complete: function () {
$('.loading').hide();
}
}
}
}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.