aspose 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
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!
 
 
subject: Validating s:select and s:checkbox with struts2 validator