Spry

Specify an invalid value

You can specify a value that registers as invalid if the user selects a menu item that is associated with that value. For example, if you specify -1 as an invalid value, and you assign the value to an option tag, the widget returns an error message if the user selects that menu item.

  1. Assign a negative value to an option tag, for example:
    <option value="-1"> ------------------- </option>
  2. Add the invalid option and the value you specified to the widget constructor, as follows:
    <script type="text/javascript">
    	var selectwidget1 = new Spry.Widget.ValidationSelect("spryselect1", {invalidValue:"-1"});
    </script>