mirror of
https://github.com/kepler155c/opus
synced 2025-01-17 10:52:53 +00:00
Fix forms numeric validation
This commit is contained in:
parent
3512b2441d
commit
457c8a8a52
@ -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'
|
||||||
|
Loading…
Reference in New Issue
Block a user