weixin_33717117 2017-02-12 19:29 采纳率: 0%
浏览 45

jQuery验证不起作用

I am using the same code for my contact us form, and trying to apply it to a quote form as well. I have duplicated the code, and added the data for AJAX. But it just does nothing, no errors at all, the form does submit. I am trying to test it by just clicking on the submit button i should get validation errors ie please enter in the information.

This works fine on my contact us form, i cannot find the issue!

http://www.aklogistics.co.uk/quote-cheap-man-and-van-hire-london.html

The JQuery code is in this file: http://www.aklogistics.co.uk/js/views/view.contact.js

  • 写回答

2条回答 默认 最新

  • perhaps? 2017-02-12 20:38
    关注

    <input type="checkbox" required="" aria-required="true"> this checkbox in 'Get Quote' page is not having any id and name, so jquery-validation is not able to reference it, that is why it is returning type undefined. Replace this checckbox with <input type="checkbox" name="agree" id="agree" required="" aria-required="true" class="error">

    After a long debugging I found out this, give an id and name to your checkbox and validation will work accordingly.

    评论

报告相同问题?

悬赏问题

  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改