Sha256: 5d89bb56f640d92e1ec0d34cf4ce964930a5e443aae29ee1a77ac2f7c2216fa7
Contents?: true
Size: 806 Bytes
Versions: 4
Compression:
Stored size: 806 Bytes
Contents
(function($) { $.fn.bootstrapValidator.i18n.siren = $.extend($.fn.bootstrapValidator.i18n.siren || {}, { 'default': 'Please enter a valid SIREN number' }); $.fn.bootstrapValidator.validators.siren = { /** * Check if a string is a siren number * * @param {BootstrapValidator} validator The validator plugin instance * @param {jQuery} $field Field element * @param {Object} options Consist of key: * - message: The invalid message * @returns {Boolean} */ validate: function(validator, $field, options) { var value = $field.val(); if (value === '') { return true; } if (!/^\d{9}$/.test(value)) { return false; } return $.fn.bootstrapValidator.helpers.luhn(value); } }; }(window.jQuery));
Version data entries
4 entries across 4 versions & 2 rubygems