code: function handleFieldValidated( isValid, msg ) {
  		var input = this.getInputElement();
  		if ( input )
  			isValid ? input.removeAttribute( 'aria-invalid' ) : input.setAttribute( 'aria-invalid', true );
  
  		if ( !isValid ) {
  			if ( this.select )
  				this.select();
  			else
  				this.focus();
  		}
  
  		msg && alert( msg );
  
  		this.fire( 'validated', { valid: isValid, msg: msg } );
  	}
docs: Handle dialog element validation state UI changes.