如何在jQuery PHP中验证后禁用提交表单上的“锚点”
how to disable 'anchor' on submit form after validation in jQuery php
我有一个小问题,正在验证提交时的表单,然后我正在发送它,但我需要禁用我的提交按钮,如果验证成功,请单击这是我的按钮代码
<button type="submit" class="btn btn-primary " id="submitBtn"><i class="fa fa-envelope"></i> Kişi Kayıt</button>
这是我的jQuery代码
..... here is validation codes .....
submitHandler: function(form) {
$.ajax({
url: 'plugin/clientIssues.php?tU=1',
type: "POST",
data: $('#userReg').serialize(),
success: function(response) {
alert(response); // show response from the php script.
window.setTimeout('location.reload()', 300);
}
});
return false;
$form.submit();
}
});
你知道我可以放在哪里吗
$('#submitBtn').hide();
如果验证正确并按下提交按钮?
在你的成功函数中:
success: function(response) {
alert(response); // show response from the php script.
$('#submitBtn').hide();
window.setTimeout('location.reload()', 300);
}
虽然我(个人)只是禁用按钮:
success: function(response) {
alert(response); // show response from the php script.
$('#submitBtn').attr('disabled','true');
window.setTimeout('location.reload()', 300);
}
相关文章:
- HTML表单提交时未执行外部函数
- JS表单提交"无法使用Chrome数据保护程序加载此页面.尝试重新加载页面.调试信息:POST CISmtuK
- 将图像上传ajax与表单提交ajax相结合
- Javascript无法处理表单提交
- 如何在我的情况下禁用表单提交
- 加载后的页面与ajax表单提交不起作用
- angularjs-控制器在表单提交时未调用
- 禁用带有字符白名单的表单提交
- 如何使用Google Analytics跟踪表单提交
- 使用javascript将表单提交到iframe目标中
- e.preventDefault在表单提交时被忽略
- AngularJS JQuery Ajax表单提交等效
- JavaScript表单提交帮助
- PHP表单提交和重定向
- 当所有输入文本字段都为空时,禁止表单提交,但当jquery中的任何字段不为空时允许提交
- setTimeOut AFTER jQuery表单提交
- 从函数中选择要触发表单提交的正确元素
- JavaScript表单提交没有't fire asp服务器端点击功能的提交按钮
- 表单提交问题,如何在我的URL末尾获得ID的值
- Javascript使用Confirm取消表单提交