Hi let me put the code which we are using <field property="changedAddressLine2" depends="requiredif1,minlength,maxlength"> <arg0 key="cmdetails.city"/> <var> <var-name>mask</var-name> <var-value>^[0-9, a-zA-Z]*$</var-value> </var> <var> <var-name>field[0]</var-name> <var-value>region</var-value> </var> <var> <var-name>fieldTest[0]</var-name> <var-value>EQUAL</var-value> </var> <var> <var-name>fieldValue[0]</var-name> <var-value>LAC</var-value> </var> <var> <var-name>field[1]</var-name> <var-value>addressCheckHidden</var-value> </var> <var> <var-name>fieldTest[1]</var-name> <var-value>EQUAL</var-value> </var> <var> <var-name>fieldValue[1]</var-name> <var-value>on</var-value> </var>
<arg1 name="minlength" key="${var:minlength}" resource="false"/> <arg2 name="maxlength" key="${var:maxlength}" resource="false"/> <var> <var-name>minlength</var-name> <var-value>1</var-value> </var> <var> <var-name>maxlength</var-name> <var-value>25</var-value> </var> </field> here the field is mandatory if the region is EMEA/LAC,and optional for any other region. And even if it is optional We have to still check if he enters correct data for that field. So in JSP based on these condition we are currently displaying like <logic:equal region="EMEA"><b><html:text name="addres2"/></b> </logic:equal> <logic:notEqual region="EMEA"><html:text name="addres2"/> </logic:notEqual> We are not using property files bze the same field can be mandatory for same region based on certain condition. Thanks and Regards Hanmayya Udgiri On 5/23/06, I HARIKRISHNA <[EMAIL PROTECTED]> wrote:
What is the need for validation if the field is nonmandatory and if it is required then how will you do in Struts>?>>??? [EMAIL PROTECTED] wrote: Hi, The best way to display mandatory is give your mandatory text field a color or put (*). Yes you have struts implementation for both mandatory & non-mandatory fields. even validation. Cheers, Kind regards, Rakesh Bhat -----Original Message----- From: Hanmay Udgiri [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 23, 2006 3:35 PM To: user@struts.apache.org Subject: displaying a field as bold Importance: Low Hi We have two requirements like this. 1.In my JSP page I have around 50 fields and these fields could be mandatory,optional or just plane read only fields based on some condition. Now the requirement is when the JSP is displayed,which way is good to display the field in bold if mandatory,non-bold if optional and just label if read only. Should we user any custom implementation for this or struts has any facilities for this. 2.Another is if the field is required,it should do a mandatory validation. And if optional,it should to a optional validation. In struts do have any implementation. I have around 50 field and having a indictor for each field will increase the form bean parameters. Thanks and Regards Hanmayya Udgiri --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------- Ring'em or ping'em. Make PC-to-phone calls as low as 1ยข/min with Yahoo! Messenger with Voice.