Hi Jorn, (hoping that you will get this)

firstly, I'd like to suggest a simple change to the validation plugin
that might save everyone a bit of time. Line 413 of the current
release goes:
413  var result = jQuery.validator.methods[rule.method].call(...
...which throws an error when you haven't defined any rules for that
field. I know it's inside a try/catch block, but Firefox still shows
an error when you validate for the 2nd time (even if debug option is
false).

So my suggestion is to add "if(rule.method)" to line 412, making it:
412 if(rule.method) try {
413  var result = jQuery.validator.methods[rule.method].call(...

My second suggestion would be to send something more useful in the
rules options, instead of just booleans. We could for example send the
error message, instead of having 2 separate options. Like this:
$('form').validate({
 rules{
  name: { required: 'I need your name' },
  email: { required: 'I need your email address', required: 'That is
not a valid email address'}
 }
});

What do you think?

Reply via email to