Validating select box

Rated 3.84/5 based on 840 customer reviews

A Spry Validation Select widget is a drop-down menu that displays valid or invalid states when the user makes a selection.For example, you can insert a Validation Select widget that contains a list of states, grouped into different sections and divided by horizontal lines.

validating select box-90

validating select box-9

The ID passed into the widget constructor identifies a specific HTML element.This action affects the error-message class, and by extension, the appearance of the error message.For example, the following shows a portion of the CSS rule from the Spry Validation file: By default, no state class is applied to the widget container, so that when the page loads in a browser, the error message text in the preceding HTML code example only has the .select Required Msg class applied to it.(The property and value pair for this rule is display:none, so the message remains hidden.) If the user fails to make a selection, however, Spry applies the appropriate class to the widget container, as follows: In the preceding CSS code, the state rule with the contextual selector .select Required State .select Required Msg overrides the default error-message rule responsible for hiding the error-message text.

Leave a Reply