samedi 28 janvier 2017

Validation of Checkboxes to other Checkboxes

I am looking to Validate a form or checkboxes, but the validation has some weird constraints. The checkboxes are not required for the form to be valid. So I am attaching a picture of what the form looks like to help in figuring out the best way to validate this. Picture of the form

If I am checking a checkbox to the left of the label, then the previous checkbox to the left of the label would need to be checked for it to be valid. So as in the picture if I want to check the left checkbox for Artisan then the left checkbox for Expert must be checked.

Now if I am checking a checkbox to the right of the label, then the checkbox to the left of the label must be checked along with the previous checkbox to the right of the label. Again referring to the picture, if I want to check the right checkbox for Artisan then the left checkbox for Artisan must be checked, and the right checkbox for Expert must be checked.

Lastly for the two bottom checkboxes, only one of them at a time can be checked. But that is if and only if the checkbox to the left of Expert for that label is checked. So if we look at the form, if Scholar's Guild is checked, Weaponsmith's Guild cannot be checked. And the Expert in Scholar above must be checked.

Does anyone have any thoughts on how this might be accomplished?




Aucun commentaire:

Enregistrer un commentaire