Skip to content
Permalink
Browse files

Form validation: Fixed colouring of errored fields and error summary …

…on form reset

Fixes #6652
  • Loading branch information...
pjackson28 committed Jun 18, 2015
1 parent bf55af4 commit f494fa71239bfb4944d9ca7c97b123f3a243f2f8
Showing with 5 additions and 6 deletions.
  1. +5 −6 src/plugins/formvalid/formvalid.js
@@ -274,22 +274,21 @@ var componentName = "wb-frmvld",

// Clear the form and remove error messages on reset
$document.on( "click vclick touchstart", selector + " input[type=reset]", function( event ) {
var $summaryContainer,
which = event.which,
var which = event.which,
ariaLive;

// Ignore middle/right mouse buttons
if ( !which || which === 1 ) {
validator.resetForm();
$summaryContainer = $form.find( "#" + errorFormId );
if ( $summaryContainer.length > 0 ) {
$summaryContainer.empty();
}
$( "#" + errorFormId ).detach();

ariaLive = $form.parent().find( ".arialive" )[ 0 ];
if ( ariaLive.innerHTML.length !== 0 ) {
ariaLive.innerHTML = "";
}

// Correct the colouring of fields that are no longer invalid
$form.find( ".has-error" ).removeClass( "has-error" );
}
} );

0 comments on commit f494fa7

Please sign in to comment.
You can’t perform that action at this time.