title: JQuery.Validate adding dynamic rules with messages
body: <p>I have a form on which I am using jquery.validate. I initially call validate with a set of rules and custom messages...</p>
  
  <pre><code>$("#formName").validate( {
    rules: {
      myExistingInput: {
        required: true
      }
    },
    messages: {
      myExistingInput: {
        required: "Enter something"
      }
    },
    ignore: null, // include hidden fields (see below)
    submitHandler: function(form) {
      // do stuff
    },
    invalidHandler: function(event, validator) {
      // do stuff (some of the fields may have been hidden by a collapsible panel
      // if there is an error on one of those fields, expand the panel so the error
      // becomes visible)
    }
  });
  </code></pre>
  
  <p>Later, I dynamically add fields to the form, and add rules for those fields too...</p>
  
  <pre><code>$("#formName").append(...);
  
  $("#newInputName").rules("add", {
    required: true,
    messages: {
      required: "Enter something else"
    }
  });
  </code></pre>
  
  <p>If I then submit the form, I get an error from within jquery.validate...</p>
  
  <blockquote>
    <p>Exception occured when checking element newInputName, check the
    'messages' method.TypeError: Unable to get property 'call' of
    undefined or null reference</p>
  </blockquote>
  
  <p>Debugging in the browser, I can see the error is being thrown from within the "check" function, and that the "method" variable is set to "messages".</p>
  
  <p>If I remove the messages from the call to rules("add",...</p>
  
  <pre><code>$("#newInputName").rules("add", {
    required: true
  });
  </code></pre>
  
  <p>it works as expected, but obviously I now have no custom error messages. </p>
  
  <p>I have seen many examples here on SO indicating that my syntax is correct. Any suggestions?</p>
  
  <p>BTW: jQuery Validation Plugin - v1.11.0 - 2/4/2013</p>