Ok, fatto !
Grazie
Posto il codice nel caso qualcuno ne avesse bisogno:
codice HTML:$().ready(function() { $.validator.addMethod( "regex_hhmm", function(value, element, regexp) { var check = false; return this.optional(element) || regexp.test(value); } ); $("#id_form").validate({ rules: { campo_hhmm: { required: true, regex_hhmm: /^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$/, maxlength: 5 } }, messages: { campo_hhmm: { required: "<= campo obbligatorio", regex_hhmm: "<= inserire ora minuti nel formato hh:mm", maxlength: "max 5 caratteri" } } }); });

Rispondi quotando