val
# val - form validation.
Load with: use val
Quick example
use val
result = valre("hello")
prn(result)
Functions
Validator state
valne()
Creates a new instance.
Rule helpers
valre(msg)
Performs the operation. Takes msg.
valmi(n, msg)
Performs the operation. Takes n, msg.
valma(n, msg)
Performs the operation. Takes n, msg.
valrg(lo, hi, msg)
Performs the operation. Takes lo, hi, msg.
valpa(p, msg)
Parses. Takes p, msg.
vemal(msg)
Performs the operation. Takes msg.
Add rule to validator
valad(v, fld, rule)
Adds an item. Takes v, fld, rule.
Validate object
valgo(v, o)
Performs the operation. Takes v, o.
valch(v, r)
Checks a condition. Takes v, r.
Quick validate
valok(o, rts)
Performs the operation. Takes o, rts.
Error messages
valst(v)
Sets a value or starts a process. Takes v.
Per-field errors
valef(v, f)
Performs the operation. Takes v, f.
Notes
- Value validation - required, type, range, regex, custom rules.