aspose file tools*
The moose likes Struts and the fly likes Validation of select boxes using struts validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validation of select boxes using struts validator" Watch "Validation of select boxes using struts validator" New topic
Author

Validation of select boxes using struts validator

Pushkar Chowdhary
Greenhorn

Joined: Dec 10, 2006
Posts: 14
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.


Of all the things I've lost, I miss my mind the most...!!!
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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 ]

Merrill
Consultant, Sima Solutions
Pushkar Chowdhary
Greenhorn

Joined: Dec 10, 2006
Posts: 14
Thanks for the reply Merrill.

Its working fine now.
Laxman Chowdary
Greenhorn

Joined: Apr 11, 2012
Posts: 21

Thank you so much Merrill Higginson...
Really Great.. Helped me a lot...

With Best Regards,
Laxman Chowdary
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validation of select boxes using struts validator
 
Similar Threads
Javascript Validation
Struts 2 Validation
new to struts
Problems with Struts 2 number validation
Struts2: use EmailValidator in my validate() method?