File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Validating s:select and s:checkbox with struts2 validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validating s:select and s:checkbox with struts2 validator" Watch "Validating s:select and s:checkbox with struts2 validator" New topic
Author

Validating s:select and s:checkbox with struts2 validator

D kukreja
Ranch Hand

Joined: Jan 29, 2008
Posts: 39
Can I validate for "required" for my s:select and s:checkbox fields.
I am using struts2 validator framework to perform front end validations. text boxes are getting validated properly. but for selection adn checkbox it always shows the field error.
Heres the xml part from my action-validation.xml

Heres from the jsp


Even if I select something in job role, it gives me error that noting is selected.
My question is "is it evenpossible to validate fields other than textfield " using struts 2 validator?
if not, how do I hook up my own javascript?
thanks
D kukreja
Ranch Hand

Joined: Jan 29, 2008
Posts: 39
I resolved this by using fieldexpression.
its working fine for me.thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validating s:select and s:checkbox with struts2 validator