Browse Source

Add numeric validator on number inputs with a decimal step.

Azuka Okuleye 11 years ago
parent
commit
7cf84c03ac
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/js/validator/numeric.js

+ 3 - 0
src/js/validator/numeric.js

@@ -4,6 +4,9 @@
     });
 
     $.fn.bootstrapValidator.validators.numeric = {
+        enableByHtml5: function($field) {
+            return ('number' == $field.attr('type') && ( typeof($field.prop('step')) !== 'undefined' && $field.prop('step') % 1 !== 0  ));
+        },
         html5Attributes: {
             message: 'message',
             separator: 'separator'