Sha256: 68168dceee81364b2cea2390cc594957881e9feaaff4b08609189b1768b4018d
Contents?: true
Size: 856 Bytes
Versions: 4
Compression:
Stored size: 856 Bytes
Contents
(function($) { $.fn.bootstrapValidator.i18n.mac = $.extend($.fn.bootstrapValidator.i18n.mac || {}, { 'default': 'Please enter a valid MAC address' }); $.fn.bootstrapValidator.validators.mac = { /** * Return true if the input value is a MAC address. * * @param {BootstrapValidator} 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) { var value = $field.val(); if (value === '') { return true; } return /^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$/.test(value); } }; }(window.jQuery));
Version data entries
4 entries across 4 versions & 2 rubygems