1

This is driving me nuts. The jQuery validation plugin doesn't seem to be doing anything at all. Here's the code: http://jsfiddle.net/pkyGf/

This is the validate code which is causing the error.

<script>
    $(function(){
      $('#purchase').validate({
        rules:{
          course:{
            minLength:1
          },
          creditCard: {
            required: true,
            creditCard: true
          },
          expMonth: {
            required: true,
            min: 1,
            max: 12,
            digits: true
          },
          expYear: {
            required: true,
            min: 12,
            max: 60,
            digits: true
          }
        }
      })
    })
  </script>

Thanks to anyone who can help. EDIT: solved, see below.

Jon Taylor
  • 7,865
  • 5
  • 30
  • 55
Abraham
  • 20,316
  • 7
  • 33
  • 39
  • 2
    You are getting the following error `Uncaught TypeError: Cannot call method 'call' of undefined` in the validate js file on line 29. This may give you an indication as to what you are doing wrong. – Jon Taylor Jul 15 '12 at 13:35
  • Aw, come on, I can't believe I missed that... Seems like I used the wrong case for minlength, writing it as minLength. Sorry about missing the error message - I just looked in the error console on page load, not after entering a value...Thanks for the help. – Abraham Jul 15 '12 at 13:39
  • 1
    Dont feel bad, I once put a question in for help and never noticed I didnt put the "." in front of Ajax – Brad Jul 15 '12 at 18:37

1 Answers1

2

I thought id put it as an answer in case people are wondering.

The error occurs when any input is actually entered (i.e. when it tries to validate). This error is on line 29 of validate js file. The error is as follows: Uncaught TypeError: Cannot call method 'call' of undefined.

From your comment above it seems this was due to using the wrong case on minlength attribute.

Jon Taylor
  • 7,865
  • 5
  • 30
  • 55