vendredi 9 janvier 2015

make field required if a minimum number of checkboxes is checked

I'm trying to figure out how to get a custom validator created that checks if any of the checkboxes from a group are checked, doesn't matter if it's one or all, and then validate an email field and make sure it's required, or filled in with a valid email.


My first thought was to just pass in the name of the group of checkboxes and have the validator validate that it's passing, since Parsley is already validating that group to make sure that one of the boxes is checked. But I'm not sure how to access the parsley form instance from inside the validator or if you can even do it this way.


The custom validator documentation is a little confusing to me.





Aucun commentaire:

Enregistrer un commentaire