formvalidation
Version:
The best jQuery plugin to validate form fields. Support Bootstrap, Foundation, Pure, SemanticUI, UIKit and custom frameworks
37 lines (36 loc) • 1.43 kB
JavaScript
/**
* blank validator
*
* @author https://twitter.com/nghuuphuoc
* @copyright (c) 2013 - 2015 Nguyen Huu Phuoc
* @license http://formvalidation.io/license/
*/
(function($) {
FormValidation.Validator.blank = {
/**
* Placeholder validator that can be used to display a custom validation message
* returned from the server
* Example:
*
* (1) a "blank" validator is applied to an input field.
* (2) data is entered via the UI that is unable to be validated client-side.
* (3) server returns a 400 with JSON data that contains the field that failed
* validation and an associated message.
* (4) ajax 400 call handler does the following:
*
* bv.updateMessage(field, 'blank', errorMessage);
* bv.updateStatus(field, 'INVALID');
*
* @see https://github.com/formvalidation/formvalidation/issues/542
* @see https://github.com/formvalidation/formvalidation/pull/666
* @param {FormValidation.Base} validator The validator plugin instance
* @param {jQuery} $field Field element
* @param {Object} options Can consist of the following keys:
* - message: The invalid message
* @returns {Boolean}
*/
validate: function(validator, $field, options) {
return true;
}
};
}(jQuery));