1
此代碼是從另一個文件複製,它在該文件中工作,我檢查了變量和表單ID,我確信該名稱與js代碼一致。 genFrom中的文本框也驗證正在工作,只有複選框不起作用。爲什麼jquery validate插件不能驗證我的複選框?
<script src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js"></script>
<script>
$(document).ready(function(){
$("#genForm").validate();
$("#genForm").validate({
rules: {
agree: {
required: true
}
}
})
});
</script>
<form id="genForm" method="post" action="verify.php">
<div class="container">
<div class="hero-unit">
<h1>Subscribe for final</h1>
</div>
<div class="clearfix">
<label>Email</label>
<div class="input">
<input name="Email" type="text" class='required'>
</div>
</div>
<br>
<br>
<div class="clearfix">
<label>Agreements:</label>
<div class="input">
<ul class="inputs-list">
<li>
I accept the terms and conditions.
<!-- Check box is here, not working -->
<input type="checkbox" name="agree" value="1">
</li>
</ul>
</div>
</div>
<br>
<input class="btn primary" type="submit" value="Submit">
</form>
你有什麼錯誤嗎? – Abhidev 2012-03-26 05:50:01