Diciamo che ho un addMethod personalizzato per jQuery Convalidare come:
$.validator.addMethod('min-length', function (val, element) { // do stuff // the error message here needs to be dynamic }, 'The field cannot be less than than ' + element.attr('data-min') + // it is within the closure, but it can't grab it ' length.');
Non riesco a capire un modo per ottenere la variabile elemento in questione, e ottenere qualsiasi valore da esso. Cosa mi manca qui?