Permalink
Browse files

Core: Ignore readonly as well as disabled fields.

Closes #1261
Closes #1262
  • Loading branch information...
colemanw authored and jzaefferer committed Sep 6, 2014
1 parent d36d1bc commit 9f4ba10ea79b4cf59225468d6ec29911f0e53a0a
Showing with 7 additions and 1 deletion.
  1. +1 −1 src/core.js
  2. +6 −0 test/test.js
View
@@ -520,7 +520,7 @@ $.extend( $.validator, {
// select all valid inputs inside the form (no submit or reset buttons)
return $( this.currentForm )
.find( "input, select, textarea" )
- .not( ":submit, :reset, :image, [disabled]" )
+ .not( ":submit, :reset, :image, [disabled], [readonly]" )
.not( this.settings.ignore )
.filter( function() {
if ( !this.name && validator.settings.debug && window.console ) {
View
@@ -786,6 +786,12 @@ test( "dynamic form", function() {
$( "#agb" ).attr( "disabled", false );
v.form();
errors( 1 );
+ $( "#agb" ).attr( "readonly", true );
+ v.form();
+ errors( 0 );
+ $( "#agb" ).attr( "readonly", false );
+ v.form();
+ errors( 1 );
});
test( "idOrName()", function() {

0 comments on commit 9f4ba10

Please sign in to comment.