Hey, I've been reading the source code for the past hour, and not sure if I'm going to have to FORK in order to get the functionality I need.  My conclusion so far is, I basically have to write a lot of functions myself and jquery.validate will allow me to plug them in.  It would be nice if the default was what I am looking for...
Essentially, putting strings (like error messages) in javascript code is not the best of ideas because (enter globalization) it forces either the javascript to be aware of how to translate content depending on locale, or it forces the javascript to be generated.  
I don't like either option because lots of server side technologies have built in globalization that the javascript could remain blissfully unaware of (thus decoupling -> minimizing complexity).
Strings are content, and content belongs in markup.  
Therefore, I am looking for: 
<form>
<input name="thePass" type="password" data-min-length="6" /><label for="thePass" class="error"> The password must be at least 6 characters </label>
</form>

<javascript>$('form').validate(); </javascript>
Should just work out of the box.  Am I missing something?  Or do I really gotta FORK it?

Date: Thu, 16 May 2013 10:12:09 -0700
From: notifications@github.com
To: jquery-validation@noreply.github.com
Subject: Re: [jquery-validation] Added support for generic messages via data-msg attribute (#747)

In jquery.validate.js:

>  		customDataMessage: function( element, method ) {
> -			return $(element).data("msg-" + method.toLowerCase()) || (element.attributes && $(element).attr("data-msg-" + method.toLowerCase()));
> +			var methodMessage = $(element).data("msg-" + method.toLowerCase()) || (element.attributes && $(element).attr("data-msg-" + method.toLowerCase()));

The || does work if it is at the end of the last line instead of the start (from your previous JSHint error)


—
Reply to this email directly or view it on GitHub.