Gyroscope / Validation Utilities

By default, validators.js defines a few data types for client-side validation:

valstr - is it a non-empty string?
valemail - does the string conform to an email format?
valdate - enforces yyyy-mm-dd format
valfloat - is it a numeric type?
valrate - is the value a percentage? e.g. 5.2%
valint - is the value non-decimal numeric
valcurrency - enforces a monetary format of the current locale (v12.4)

There are several subtle but important reasons why we'd want to store the
input field objects in temporary variables (the ones that begin with "o"). The
first reason is that a validation function needs access to the object, so that it
can change the background color of the input field to red if the value fails to
validate.

A second reason is to make the code more compact. Without the o-variables,
the code could look like this: