Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validation of select boxes using struts validator

 
Pushkar Chowdhary
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks for the reply Merrill.

Its working fine now.
 
Laxman Chowdary
Greenhorn
Posts: 21
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much Merrill Higginson...
Really Great.. Helped me a lot...

With Best Regards,
Laxman Chowdary
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic