• 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

Validation of select boxes using struts validator

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello all,

I'm using struts 1.3.5 with its validation.xml in my application which contains a single-select box. i'm not able to validate the select box using the default validator.

Can anyone please tell me how i can achieve that?

My aim is to show a warning when a user doesn't select anything from the select box.

I have one more query. earlier, i was using the email, minlength and maxlength validators only once in my form. at that time, the validation process was working properly. but then i added a few more fields. and hence i applied these validators to them as well. but, after that, the validation process is not happening at all. it only checks for the "required" fields and if they are filled, it completes the transaction successfully, without checking other validators.

Can you guys please help?

Thanks,
Pushkar.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pushkar Chowdhary:
I'm using struts 1.3.5 with its validation.xml in my application which contains a single-select box. i'm not able to validate the select box using the default validator.


You can use the "required" validator for a select box provided one of the options looks like this:

If this option is the one selected, the validator will reject the entry if you've applied the "required" validator to the property specified in the <html:select> tag.
[ December 13, 2006: Message edited by: Merrill Higginson ]
 
Pushkar Chowdhary
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply Merrill.

Its working fine now.
 
Greenhorn
Posts: 21
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much Merrill Higginson...
Really Great.. Helped me a lot...

With Best Regards,
Laxman Chowdary
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic