JQuery验证"remote"方法响应等待消息
JQuery validation "remote" method response waiting message
我正在使用 JQuery 验证插件 "remote" 方法进行基于 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();
}
}
}
}
});
我正在使用 JQuery 验证插件 "remote" 方法进行基于 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();
}
}
}
}
});