diff --git a/src/core.js b/src/core.js index b7c62c04c..5a2fb1ce4 100644 --- a/src/core.js +++ b/src/core.js @@ -1607,7 +1607,6 @@ $.extend( $.validator, { validator.settings.messages[ element.name ][ method ] = previous.originalMessage; if ( valid ) { submitted = validator.formSubmitted; - validator.resetInternals(); validator.toHide = validator.errorsFor( element ); validator.formSubmitted = submitted; validator.successList.push( element ); diff --git a/test/index.html b/test/index.html index 17c6438b8..f27ad1d76 100644 --- a/test/index.html +++ b/test/index.html @@ -72,6 +72,10 @@

+
+
+ +
diff --git a/test/test.js b/test/test.js index 298df0dbc..02462c933 100644 --- a/test/test.js +++ b/test/test.js @@ -2060,6 +2060,37 @@ QUnit.test( "[Remote rule] #1508: Validation fails to trigger when next field is check( "abc" ); } ); +$.mockjax( { + url: "issue2150TestForm.action", + response: function() { + this.responseText = "true"; + }, + responseTime: 1 +} ); + +QUnit.test( "Remote validation should not reset existing errors (#2150)", function( assert ) { + assert.expect( 3 ); + var done = assert.async(); + $( "#issue2150TestForm" ).validate( { + rules: { + remoteTestedInput: { + remote: "issue2150TestForm.action" + }, + requiredInput: "required" + } + } ); + + assert.equal( $( "#requiredInput" ).attr( "class" ), undefined, "#requiredInput should not have any class" ); + + var isValid = $( "#issue2150TestForm" ).valid(); + + setTimeout( function() { + assert.equal( $( "#requiredInput" ).attr( "class" ), "error", "#requiredInput should have \"error\" class" ); + assert.equal( isValid, false, "Form should have error" ); + done(); + } ); +} ); + QUnit.test( "validate checkbox on click", function( assert ) { function errors( expected, message ) { assert.equal( v.size(), expected, message ); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy