I don't think you can do this without either a custom validator or as Jim suggests, implementing it in the validate method of your form.
Niall On 2/9/07, Jim Reynolds <[EMAIL PROTECTED]> wrote:
It appears you are probably using the ValidatorForm or ValidatorActionForm in 1.x? Just a thought ... could you just implement the validate method in the Action form and handle it with logic? I did some looking, and see that you can validate two fields against each other, but I couldn't find anywhere to do if/else logic in the validation.xml file. Possibly the Struts cookbook may have an example, but I don't have that book here. Maybe someone else on the list may have that. On 2/9/07, fea jabi <[EMAIL PROTECTED]> wrote: > can someone help me with this please. thanks. > > > >From: "fea jabi" <[EMAIL PROTECTED]> > >Reply-To: "Struts Users Mailing List" <user@struts.apache.org> > >To: user@struts.apache.org > >Subject: validation help > >Date: Thu, 08 Feb 2007 10:01:01 -0500 > > > > > > > >Have 2 radio buttons of ID and Name and an input field to enter criteria. > > > > > >When the ID is selected the criteria the user entered should be numeric. > >Should display the user with the appropriate message that only int > >value is allowed. > > > >When the Name is selected the criteria the user entered > >should be alphanumeric. Should display appropriate message that only > >alphanumeric values are allowed. > > > >Tried the below it works great for the second option. Not sure how can I > >join > >the two conditions. > > > > <formset> > > <form name="search"> > > <field property="criteria" depends="mask"> > > <msg name="mask" key="error.alphanumeric"/> > > <arg0 name="mask" key="lbl.criteria" /> > > <var> > > <var-name>mask</var-name> > > <var-value>${alpha_numeric}</var-value> > > </var> > > </field> > > </form> > > </formset> > > > >You help is appreciated. Thanks. > > > >_________________________________________________________________ > >Laugh, share and connect with Windows Live Messenger > >http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=hmtagline > > > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > _________________________________________________________________ > Turn searches into helpful donations. Make your search count. > http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_donation&FORM=WLMTAG > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]