14 December 2009

From Organic Design wiki
Warning.svg This is a blog item that needs to be converted to the new Bliki format

Vanadium form validation

We're now ready to use Vanadium for our form validation, but there are some restrictions due to the dual-use nature of our forms (that the same forms are used for creation, updating and searching for records).

When the form is used for searching no validation should occur because a completely empty form is legitimate for a search query, and also every field must allow regular expression characters when searching.

For this reason the ":only_on_submit" option must be used so that the Vanadium validation only occurs when the form is submitted not dynamically as fields entries are changed. E.g.

<input class=':required :only_on_submit' />

In addition to this, when the form is submitted validation should not occur if it was submitted by the Search button (having id "ra-find"). To do this a patch has been added to the OD JavaScript which is loaded by all OD wikia wiki's.