这里我有 HTML:
<form id="referalForm" action="google.com">
<label>Referring patient:</label>
<input type="text" ame="txtPname" id="fullname" placeholder="ENTER YOUR FULL NAME" />
<label>Email invitaion(s):</label>
<div class="clear10"></div>
<input type="email" name="emailP[]" id="emailP1" placeholder="ENTER RECIPIENT`S EMAIL" />
<label id="lblO1"></label>
<input type="email" name="emailP[]" id="emailP2" placeholder="ENTER RECIPIENT`S EMAIL" />
<label id="lblO2"></label>
<input type="email" name="emailP[]" id="emailP3" placeholder="ENTER RECIPIENT`S EMAIL" />
<label id="lblO3"></label>
<input type="hidden" name="UserEmail" id="UserEmail" value="" />
<input type="hidden" name="UserID" id="Userid" value="" />
<div align="center"><input type="button" value="SEND" class="button_red" onclick="validateForm(this.form);" style="width:80%;" /></div>
</form>
这是我的jQuery代码:
function validateForm(form){
var validate = $("#referalForm").validate({
rules:{
txtPname:{
required: true
},
"emailP[]":{email:true}
},
messages:{
txtPname:{
required: "Please Enter Your Full Name"
},
"emailP[]":{email:"Please Enter Correct Email"}
},
focusInvalid: false
});
}
它根本不工作我无法添加 $(document).ready 因为我在移动设备上验证它并且它不工作任何人都可以告诉我如何使它工作?我累了,花了大约 24 小时仍然无法...