• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how can use conditional validations on predefined validations in struts1.2

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
in struts-config.xml

i am using DynavalidatorForm.

form fields are suppose assume field1 and field2.
i need to validate integer,required for both fields.
but my requirement is if field1 is selected and typed then need not validate field2.
when i am using validwhen,integer and required for field2
even thought validwhen is working,required,integer validations are validating on field2.
i need not validate required,integer validations when field1 is selected and
typed integer.
any solutions....
 
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
instead of having 'required' for field2, use validwhen. in the end, i think the validation rules for both field1 and field2 should be EXACTLY the same (e.g neither should have the 'required' dependency).

the 'integer' may cause some problem as int is default to '0'. you may want to consider using 'mask' ( ^[0-9]+$ ) to check for numeric only which is the same as 'integer'.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic