BoltWire

Innovative Ideas :: Radical Results!

INFORMATION

DOCUMENTATION

SOLUTIONS

Validation

Documentation > Forms > Validation

BoltWire has several fairly sophisticated built in form validation systems. Be sure to put these line in your form BEFORE any commands are executed that depend on validated values.

Required fields
You can specify required fields in a form like this. It gives a warning and aborts form processing if a required field is blank.

[session required field1,field2,field3]

Pattern matching
This allows you test a field by some pattern and trigger actions to specified fields (1 & 2) if it passes, or other fields (3) if it fails. Watch the syntax carefully--particularly the spacing.

[session validate_field1 "/somepatt/ ? field1=whatever , field2=whatever : field3=whatever"]

Usually there is combined with a

[session warn]

line after the validation line(s) and before any commands are executed that depend on the validation. Then in the validate command, you simply assign an message to the warn field when a validation fails.

Conditionals
This option taps into any conditional BoltWire can understand and then behaves similarly based on whether the condition returns true or false. It works similarly to the validate (pattern matching) command.

[session if "conditional {=field2} whatever ? field1=whatever , field2=whatever : field3=whatever"]

Copyright © 2013, all rights reserved.