這工作...jQuery驗證的JavaScript定義的規則不工作
<input type="text" id="valid" width="200px" minlength="5" />
這不......
<input type="text" id="valid" width="200px" />
...
$(document).ready(function() {
$('#validationform').validate({
rules: {
valid: {
minlength:5
}
},
messages: {
valid: {
minlength: "Need more characters"
}
}
});
});
JavaScript已經在在頭部鏈接文件validationrules.js
保存關閉部分。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="<?php echo base_url();?>js/jquery.validate.min.js"></script>
<script src="<?php echo base_url();?>js/validationrules.js"></script>
我可能錯過了很簡單的事情。它是什麼?提前致謝。
輸入名字也許? –