Ox.Input: fix integer regexp

This commit is contained in:
rolux 2012-07-09 15:59:28 +02:00
parent d930affb05
commit cfa16327a5

View file

@ -546,7 +546,7 @@ Ox.Input = function(options, self) {
'(^' + (self.options.min < 0 ? '\\-?' : '') + '\\d+\\.?\\d' '(^' + (self.options.min < 0 ? '\\-?' : '') + '\\d+\\.?\\d'
+ (self.options.decimals ? '{0,' + self.options.decimals + '}' : '*') + (self.options.decimals ? '{0,' + self.options.decimals + '}' : '*')
+ '$)' + '$)'
) : new RegExp('(^' + (self.options.min < 0 ? '\\-?' : '') + '\\d+)'); ) : new RegExp('(^' + (self.options.min < 0 ? '\\-?' : '') + '\\d+$)');
if (type == 'float') { if (type == 'float') {
if (value === '') { if (value === '') {
value = '0.' + self.decimals; value = '0.' + self.decimals;