浏览代码

Add numeric validator on number inputs with a decimal step.

Azuka Okuleye 11 年之前
父节点
当前提交
7cf84c03ac
共有 1 个文件被更改,包括 3 次插入0 次删除
  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'