9 2 3 Controlling When Validation Occurs

LANSA WAM

9.2.3 Controlling When Validation Occurs

The default browser behavior is to perform validation when the user submits the form. The LANSA framework offers two options to extend this: after the user has entered data in a field and moved the focus away, and immediately while the user is typing. To enable these options, add one of the following classes to the page <div>: lstdErrorImmediately or lstdErrorAfterFocus. The standard shipped layouts do this using the validationTime property.

While most validation can be performed at these other times, some browsers may have exceptions for specific scenarios. For example, Safari will not invalidate a required field after focus unless the user has made some attempt to enter data in it. This allows a user to tab through fields while filling in a form without being hit with errors along the way.