캠페인 모니터의 양식을 모바일 사이트에 연결했으며 유효성 검사를 위해 jQuery 유효성 검사를 사용하고 있습니다. 모두 잘 데스크톱 브라우저에서 작동하지만 내 아이폰을 확인할 때 유효성 검사가 작동하지 않습니다.iphone에서 jQuery 유효성 검사가 작동하지 않습니다.
저는 JQuery를 사용한 경험이 없기 때문에 어떤 도움을 주시면 감사하겠습니다.
미리 감사드립니다. 다음과 같이
라이브 데모 http://files.perfectday.gb.com/internal/stackoverflow/mobile-form/get-your-coupon.php
내 검증 JQuery와 및 형태이다.
$("form").validate({
onsubmit: false
});
:
<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
"유효성 검사가 작동하지 않습니다"라고 말하면 무엇을 의미합니까? 내 아이폰과 시뮬레이터와 함께이 두 가지를 시도하고 양식을 제출하면 자바 스크립트 오류가 발생하지 않습니다. 또한 수학 문제 옆에 "다시 시도하십시오"라는 텍스트가 있습니다. 일반적으로 iPhone의 Safari 디버그 콘솔을 켜는 것이 좋습니다. 설정 -> 사파리 -> 고급 -> 디버그 콘솔에서 찾을 수 있습니다. –
유효성 검사를 통해 올바른 정보가 입력 될 때까지 보낸 사람이 제출할 수없는 기능을 의미했습니다. 이 문제는 jquery-1.7.1이 작동하지 않는다는 거짓말을했습니다. 왜 그런지 완전히 모르겠습니다. JQuery v1.3.2가 지금 나에게 효과가있는 것 같다. – perfectday