Validation of numeric fields with decimal steps
@@ -5,7 +5,7 @@
$.fn.bootstrapValidator.validators.integer = {
enableByHtml5: function($field) {
- return ('number' === $field.attr('type'));
+ return ('number' == $field.attr('type') && ( typeof($field.prop('step')) == 'undefined' || $field.prop('step') % 1 === 0 ));
},
/**
@@ -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'