struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aruna....@gmail.com
Subject Re: Re: Help with S:Select
Date Fri, 04 Dec 2009 18:47:17 GMT
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 aruna.hcu@gmail.com at openSubscriber.com
http://www.opensubscriber.com/message/user@struts.apache.org/10986643.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message