我正在尝试使用jquery技术来验证Web表单(我现在正在学习)。在下载并引用我的代码中的文件后,TEXTAREA即使在分配了REQUIRED类属性后仍然顽固地拒绝验证。请别人帮忙。道歉,如果它是微不足道的。 这是代码:
<script type ="text/JavaScript" src = "jquery.js"></script>
<script type ="text/JavaScript" src ="jquery.validate.js"></script>
<script type ="text/JavaScript">
$(document).ready(function(){
$("#reg").validate();
})// end of ready()
来自代码:
<form id = 'reg' method ='post' action =''>
<label for 'username'>User Name **</label>
<input type ='text' name ='username' id ='usN' class = 'required' title = "Enter Your name"><br/>
<label for 'Address'> Address **</label>
<input type ='text' id ='addr' class = 'required' title = "Enter Your Address"><br/>
<label for 'comment'>Comment Below **</label>
br/> <textarea id ='comm' rows =5, cols = 18 class ='required' title = 'Make a comment'></textarea><br/>
<input type ='submit' id = 'button1' value = 'SEND'>
</form>
答案 0 :(得分:3)