使用 jquery.validationEngine 启用/禁用按钮
我正在使用 这个< /a> jQuery 表单验证器,但我不明白如何在这里做一件简单的事情:如果表单无效,则禁用提交按钮,否则启用提交按钮。
一点代码:
<script type="text/javascript">
$(document).ready(function() {
$("#registration_form").validationEngine({
//
});
});
</script>
<?php
echo "<form id=\"registration_form\">";
echo "<label for=\"name\">Name</label>";
echo "<input class=\"validate[required,custom[onlyLetter],length[3,100]]\" id=\"name\"><br />";
echo "<button type=\"submit\" id=\"submit_button\">GO</button>";
echo "</form>";
?>
I'm using this jQuery form validator but I cannot understand how to make one simple thing here: if form is not valid disable the submit button, otherwise enable submit button.
A little bit of code:
<script type="text/javascript">
$(document).ready(function() {
$("#registration_form").validationEngine({
//
});
});
</script>
<?php
echo "<form id=\"registration_form\">";
echo "<label for=\"name\">Name</label>";
echo "<input class=\"validate[required,custom[onlyLetter],length[3,100]]\" id=\"name\"><br />";
echo "<button type=\"submit\" id=\"submit_button\">GO</button>";
echo "</form>";
?>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
脚本
这是正文中的
尝试并反馈我
This is the script
in the body
try and feedback me