0

这里我有 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 小时仍然无法...

4

1 回答 1

1

我不确定为什么 ready 语句与 Mobile 有任何关系,但在这里:

您的表单正在提交,您的 txtPname "ame=txtPname" 中有一些拼写错误

我为你做了一个样品。

http://jsfiddle.net/EAaSs/

于 2012-08-29T13:28:41.397 回答