Fix forms numeric validation
This commit is contained in:
@@ -100,6 +100,7 @@ function UI.Form:validateField(field)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if field.validate == 'numeric' then
|
if field.validate == 'numeric' then
|
||||||
|
field.value = field.value or ''
|
||||||
if #tostring(field.value) > 0 then
|
if #tostring(field.value) > 0 then
|
||||||
if not tonumber(field.value) then
|
if not tonumber(field.value) then
|
||||||
return false, 'Invalid number'
|
return false, 'Invalid number'
|
||||||
|
|||||||
Reference in New Issue
Block a user