• 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

Validating certain fields while leaving others out

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I've searched for this but couldn't find a satisfying answer. Maybe I'm even thinking too complex and the answer is pretty simple. Anyway - I've got the following problem.

I've got a form with 6 fields (strings and integers - but that's not the point). The first 3 and the last 3 depend on each other. What I mean by that is that if either field 1,2 or 3 has a value the other 2 got to have a value too, while the other 3 (4,5 and 6) don't. Or you can turn it around and write something into field 4,5 or 6 and the other 2 have to be filled in, while 1,2 and 3 don't have to be filled.

Just so you know - I'm using XML-field-validators in Struts 2. I thought something like this might work, but didn't.


Maybe anyone of you has got an answer to that.
Thanks in advance.
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,

I dont think this can be achieved using the Validator Framework..I was using the validator framework from past 3years...I had a similar requirement some time back and I used Javascript validation for that..You better go for Javascript validation...

Regards,
Rama Krishna.
 
Andr� Cedik
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks - that's what I ended up with.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic