我已将活动监视器的表单链接到移动网站,并且我正在使用jQuery验证进行验证。 所有在桌面浏览器上都能正常工作,但当我检查我的Iphone时,验证无效。jQuery验证无法在iPhone上工作
我不是使用JQuery的经验,所以任何帮助将不胜感激。
预先感谢您!
现场演示 http://files.perfectday.gb.com/internal/stackoverflow/mobile-form/get-your-coupon.php
我的验证jQuery和形式如下。
<script type="text/javascript">
$.validator.methods.equal = function(value, element, param) {
return value == param;
};
$(document).ready(function(){
$("#subForm").validate({
rules: {
math: {
equal: <?php echo $randomNumTotal; ?>
}
},
messages: {
math: "Try again!!"
}
});
});
</script>
<!-- Form -->
<form action="http://perfectday.createsend.com/t/j/s/nyuyh/" method="post" id="subForm">
<div class="name">
<label for="name">Name:<span>*</span></label><br>
<input type="text" name="cm-name" id="name" size="25" class="required text-input" />
</div>
<div class="nyuyh-nyuyh">
<label for="nyuyh-nyuyh">Email Address:<span>*</span></label><br>
<input type="text" name="cm-nyuyh-nyuyh" id="nyuyh-nyuyh" size="25" class="required email text-input"/>
</div>
<div class="address1">
<label for="Address 1">Address 1:<span>*</span></label><br>
<input type="text" name="cm-f-juar" id="Address1" size="25" class="required text-input" />
</div>
<div class="address2">
<label for="Address 2">Address 2:<span>*</span></label><br>
<input type="text" name="cm-f-juaj" id="Address2" size="25" class="text-input required" />
</div>
<div class="city">
<label for="City">City/town:<span>*</span></label><br>
<input type="text" name="cm-f-juat" id="City" size="25"class="required text-input" />
</div>
<div class="postal">
<label for="postal">Post code:<span>*</span></label><br>
<input type="text" name="cm-f-juai" id="postal" size="25"class="required text-input" />
</div>
<div class="captcha">
Enter the correct result<span>*</span><br>
<input type="text" name="captchaImage" id="sum" value="<?php echo $randomNum ?> + <?php echo $randomNum2 ?>" disabled="disabled" />
<input type="text" name="math" id="math" maxlength="6" />
</div>
<input value="submit information" class="submit" type="image" src="images/trans.png" class="get-your-coupon-submit" alt="Submit" >
<br>
</form>
我的道歉。我会做。谢谢你的时间。 – perfectday 2012-02-23 17:08:23
当你说“验证不起作用”你是什么意思?我试着用我的iPhone和模拟器,并提交表单不会导致任何JavaScript错误。数学问题旁边还有一个“再试一次”的文字。 在iPhone上打开Safari的调试控制台通常很好。它可以在设置 - > Safari - >高级 - >调试控制台中找到。 – 2012-02-23 19:05:40
通过验证我的意思是在输入正确的信息之前,不允许提交的功能。这个问题与jQuery-1.7.1无关。不完全确定原因。现在JQuery v1.3.2似乎适用于我。 – perfectday 2012-02-27 09:57:09