You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by arun kumar <ar...@gmail.com> on 2006/07/14 07:54:14 UTC

Branching inside validator framework? [Needs Help........!]

Hi all,
I am using struts1.1 and i am using validator framework.I have a problem
regarding branching of validation and optional validation of some fields.

The situation is like.......
I have a search form which contains two tabs search by number and search by
name .I am using a single action form for both the tabs.When search by name
is clicked search by number validation should be kept off and
viceversa......

And if search by name tab is clicked ....validation of some fields should be
done based on some condition like if first name is given then last name
should not be validated .........

plz suggest some way to do this...........

Regards
Arun.

Re: Branching inside validator framework? [Needs Help........!]

Posted by Laurie Harper <la...@holoweb.net>.
arun kumar wrote:
> Hi all,
> I am using struts1.1 and i am using validator framework.I have a problem
> regarding branching of validation and optional validation of some fields.
> 
> The situation is like.......
> I have a search form which contains two tabs search by number and search by
> name .I am using a single action form for both the tabs.When search by name
> is clicked search by number validation should be kept off and
> viceversa......

The easiest way is probably to use the validator's 'page' feature, which 
allows you to break up a set of form validations into separate pages.

> And if search by name tab is clicked ....validation of some fields 
> should be
> done based on some condition like if first name is given then last name
> should not be validated .........

This can probably be handled using the 'validwhen' validation rule.

L.


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