Using Spring I need to validate a form possibly using annotations.
My html form contains an input type radio and some input text dependent on the radio value. How to validate only the input fields dependent on the current radio selected?
Using Spring I need to validate a form possibly using annotations.
My html form contains an input type radio and some input text dependent on the radio value. How to validate only the input fields dependent on the current radio selected?
You need to write own JSR-303 validator and put it on the class. This question already been asked several times, so there some links:
In the first answer you even may find full and working example.
If you need validate form after submit, possible use annotation @Valid, or simple frontend validation for example jquery http://jqueryvalidation.org/documentation/