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.

    评论

报告相同问题?