the below code works to make the select option required. If nothing is selected
displays the provided message.
<s:select name = "user.department" key = "user.department" headerKey="-1"
headerValue="-- Please Select --" list="allDepartments"
required="true"
requiredposition="left" />
In validation.xml
<field name="user.department">
<field-validator type="fieldexpression">
<param name="expression">!(user.department).equals("1")</param>
<message>Please select a department.</message>
</field-validator>
</field>
--
This message was sent on behalf of [email protected] at openSubscriber.com
http://www.opensubscriber.com/message/[email protected]/10986643.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]