具有 jquery 有效性的复选框
当您使用 jquery.validty.js 验证我的表单时,FF 中似乎存在问题。如果我正在验证复选框或单选按钮,则 X 图像不会显示。它可以在 safari 中运行,但我还没有尝试过 IE。有人遇到过这个问题吗?
<html>
<head>
<title>Simple</title>
<link type="text/css" rel="Stylesheet" href="css/jquery.validity.css" />
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="javascript/validate/jquery.validity.js"></script>
<script type="text/javascript">
$(function() {
$("form").validity(function() {
$("#vehicles")
.require()
.match("number")
.range(4, 12);
$("#butn").require();
$("#dob")
.require()
.match("date")
.lessThanOrEqualTo(new Date());
});
});
</script>
</head>
<body>
<form method="get" action="simple.htm">
Number of Vehicles:
<input type="text" id="vehicles" name="vehicles" title="Vehicle Count" />
<br /><br />
Date of birth:
<input type="text" id="dob" name="dob" title="Birthday" />
<br /><br />
<input type="radio" id="butn"/>
<input type="submit" />
</form>
</body>
There seems to be a problem in FF when you use jquery.validty.js to validate my forms. If I'm validating a checkbox or radio btn the X image doesn't show up. It works in safari but I haven't tried IE. Has anyone had this problem?
<html>
<head>
<title>Simple</title>
<link type="text/css" rel="Stylesheet" href="css/jquery.validity.css" />
<script src="http://code.jquery.com/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="javascript/validate/jquery.validity.js"></script>
<script type="text/javascript">
$(function() {
$("form").validity(function() {
$("#vehicles")
.require()
.match("number")
.range(4, 12);
$("#butn").require();
$("#dob")
.require()
.match("date")
.lessThanOrEqualTo(new Date());
});
});
</script>
</head>
<body>
<form method="get" action="simple.htm">
Number of Vehicles:
<input type="text" id="vehicles" name="vehicles" title="Vehicle Count" />
<br /><br />
Date of birth:
<input type="text" id="dob" name="dob" title="Birthday" />
<br /><br />
<input type="radio" id="butn"/>
<input type="submit" />
</form>
</body>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是它的要点。您必须添加自己的函数来处理它。
So here the jist of it. You have to add your own functions to handle it.