Guys from http://jqueryvalidation.org/ just released version 1.13.1. Checking on their website i see this on the changelog:
CORE: * Ignore readonly as well as disabl
You can override the original "elements" function with an implementation which quite similar to the original implementation except for the readonly field handling.
This is not an elegant solution, but it does work.
If you update your jquery validate library, you also need to recheck your overridden method.
* UpToDate * See jquery-validate-1.14
changeLog: Revert "Ignore readonly as well as disabled fields." :):)
$.validator.prototype.elements = function() {
var validator = this,
rulesCache = {};
return $( this.currentForm )
.find( "input, select, textarea" )
.not( ":submit, :reset, :image, [disabled]") // changed from: .not( ":submit, :reset, :image, [disabled], [readonly]" )
.not( this.settings.ignore )
.filter( function() {
if ( !this.name && validator.settings.debug && window.console ) {
console.error( "%o has no name assigned", this );
}
if ( this.name in rulesCache || !validator.objectLength( $( this ).rules() ) ) {
return false;
}
rulesCache[ this.name ] = true;
return true;
});
};