Fix forms numeric validation

This commit is contained in:
xAnavrins 2019-08-18 14:53:27 -04:00
parent 3512b2441d
commit 457c8a8a52
1 changed files with 1 additions and 0 deletions

View File

@ -100,6 +100,7 @@ function UI.Form:validateField(field)
end
end
if field.validate == 'numeric' then
field.value = field.value or ''
if #tostring(field.value) > 0 then
if not tonumber(field.value) then
return false, 'Invalid number'