Как проверить, активен ли хотя бы один флажок в группе, используя API проверки ограничений? - PullRequest
0 голосов
/ 02 октября 2018

Можно ли использовать «API проверки ограничений» для проверки группы флажков хотя бы для одного активного параметра?

Можно ли также применить setCustomValidity к <fieldset>?

HTML:

<form class="validate">
  <fieldset>
    <input type="checkbox" id="wood" name="wood" data-validate-group="materials">
    <input type="checkbox" id="metall" name="metall" data-validate-group="materials">
    <input type="checkbox" id="plastic" name="plastic" data-validate-group="materials">
    <!-- <span>error message from "materials" at this point</span> -->
  </fieldset>
  <fieldset>
    <input type="checkbox" id="pencil" name="pencil" data-validate-group="article">
    <input type="checkbox" id="book" name="book" data-validate-group="article">
    <input type="checkbox" id="ball" name="ball" data-validate-group="article">
    <!-- <span>error message from "article" at this point</span> -->
  </fieldset>  
</form>
...