### Spry Validation Textarea Samples

This page gives examples of the textarea widget capabilities.

This is an example of a textarea validation widget. There are three validation techniques: validation can occur as-you-type (Change), when the textarea looses focus (Blur) or only when the form is submitted (Submit). The Submit validation occurs always, regardless of the other options chosen.

Change - Submit
The value is required.
Blur - Submit
The value is required.
Submit
The value is required.

The next example shows two more of the textarea widget's features: the character counter, and the enforce max characters option.

Enter no more than 30 characters: The value is required. The maximum number of characters exceeded.

Also, you can define a minimum number of characters to be entered, and the counter can have an upward direction.

Enter at least 3 characters: The value is required. The minimum number of characters not met.

The user will receive visual feedback whenever one of his actions conflicts with the expected behavior. For example, try to enter less than 10 characters or more than 20 in the textareas below. You will receive error messages for the first one, and you won't be able to enter any more characters in the second one.

Enter between 10 and 20 characters: The value is required. The minimum number of characters not met. The maximum number of characters exceeded. Enter between 10 and 20 characters: The value is required. The minimum number of characters not met. The maximum number of characters exceeded.

You can define a separate HTML element to display the error messages for this widget.

Enter between 10 and 20 characters: The value is required. The minimum number of characters not met. The maximum number of characters exceeded.
Errors: The value for the textarea is required. The minimum number of characters criteria not met. The maximum number of characters criteria exceeded.

The following example shows how to change error messages. You can edit them directly in page, change the css class for them or remove them completely.

Enter between 10 and 20 characters: Enter your comment. You must enter at least 10 characters. Character limit exceeded.

Also, you can change the widget container to use directly the textarea label, and don't use any error messages.

Enter between 10 and 20 characters: