有谁知道如何让无线电字段类型验证正确显示在错误 div 中?现在它根本没有验证
<script src="http://jquery.bassistance.de/validate/lib/jquery.js" type="text/javascript"></script>
<script src="http://jquery.bassistance.de/validate/lib/jquery.metadata.js" type="text/javascript"></script>
<script src="http://jquery.bassistance.de/validate/jquery.validate.js" type="text/javascript"></script>
<style type="text/css">
div.error { height: 15px; overflow: hidden; }
.cmxform p.error label { color: #FFFF00; font-size: 13px; }
label.error, label.error { color: #FFFF00; font-size: 13px; }
div.container { display: none }
.container label.error { display: inline; }
form.cmxform label.error { display: block; width: auto; }
</style>
<script type="text/javascript">
$.validator.setDefaults({
submitHandler: function() {
alert("submitted!");
}
});
$().ready(function() {
$("#form1").validate({
errorLabelContainer: $("#form1 div.error")
});
var container = $('div.container');
});
</script>
形式
<form method="post" class="cmxform" id="form1" action="">
<div class="error"></div>
<input class="inputxt {required:true,minlength:3}" title="fill-in all fields" name="name" />
<input type="radio" name="website" value="Yes" validate="required" /> YES
<input type="radio" name="website" value="No" /> NO
</form>