I have my form styled with bootstrap, where e.g. input is styled with some css class. What would be the most proper/recommended solution, for marking field or bounding selector as invalid (adding e.g. css class "has-error").
Currenty, I found something like this:
<div class="form-group ${bean.nameValid ? '' : 'has-error'}">
So, basically presence of css class is based on particular method result. Does this problem has any better solution or it means that I should provide validation method for any bean's field as some sort of BeanNameFormClass or DTO? Especially when validating single field via ajax.
Aucun commentaire:
Enregistrer un commentaire