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


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 "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!
 
Don't get me started about those stupid light bulbs.
 
subject: Validating s:select and s:checkbox with struts2 validator
 
Similar Threads
validation problem for cost : struts2
Struts2 Validation - Number?
Struts2 Validation - skip validation for certain fields
Struts2 validation problem
struts2 validate a checkbox