rooseveltframework / semantic-forms

🎯 A pattern library of forms based on semantic HTML enhanced with a modern UX.
Other
8 stars 4 forks source link

checkbox error #4

Closed peterbsmyth closed 6 years ago

peterbsmyth commented 6 years ago

Given:

<form id="" action='/somewhere' method='post' class='semanticForms' data-clearfield-horizontal-offset='25' data-clearfield-vertical-offset='5'>
  <fieldset>
    <dl>
      <dt>
        <label for='statusReportedInput'>Status Reported</label>
      </dt>
      <dd>
        <input id='statusReportedInput' name='statusReportedInput' type='checkbox'>
      </dd>
    </dl>
    <input type='submit' name='submit' id='save' value='Save'>
    <input type='submit' name='cancel' id='cancel' value='Cancel'>
  </fieldset>
</form>

The following error is produced: DOMException: Failed to execute 'querySelector' on 'Document': 'label[data-for=]' is not a valid selector.

Originating from line 59 of semanticforms.js

kethinov commented 6 years ago

The markup structure doesn't match the example.

See checkboxes example: https://kethinov.github.io/semanticforms/semanticForms.html

kethinov commented 6 years ago

Reopen if you still have questions.