Spec Form Validators
Four51 Spec Form Validators are extended validation controls for specific input requirements. Every validators can be defined to fire on one of two events: onblur, onsubmit. Controls for displaying validation errors is built into each validators. The event can be overridden and controlled separately if desired. It is recommended that you do not override onSuccess or onError unless absolutely necessary. All validators have identical options exposed. By default, when validation fails a red exclamation point image is displays with mouse over error message and the control's background property is changed to pink. On success these errors are cleared. When the action is defined as "onBlur" the error is marked next to the control, however the form is still allowed to submit.
spec['Control'].number({ action: "onBlur", message: "You must enter a number.", onSuccess: function() { alert('Your entry is a number!') }, onError: function() { alert('Your entry is not a number!') });