Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Struts and the fly likes how to make one, out of two fields mandatory Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "how to make one, out of two fields mandatory" Watch "how to make one, out of two fields mandatory" New topic
Author

how to make one, out of two fields mandatory

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

Hi,

is there any way to make one out of two fields mandatory.

Suppose: my jsp is having 2 text fileds. And i want to make my user at least one text field filled using validation.xml.

how is this possioble in struts.

thanks in advance,

regards,
rahul
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Use the validwhen rule. For more information, see the Struts Validator Guide.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to make one, out of two fields mandatory
 
Similar Threads
applet to database
Validation in Struts
Dynamic form validation
Program action of a page dynamically depending on the link from where it is called
javascript regular expression related problem.