Web component / esm

<form-fieldset-progress>

README and API

Load the component from esm.sh

This example imports the published component class from esm.sh and registers it manually. Both fieldsets remain available if the CDN cannot load. Wrap your native form, then register the element with a module script. Next checks Contact details before showing Delivery notes; Submit appears on the last step. This demo reports submission without sending data when JavaScript is available.

<form-fieldset-progress>
  <form action="./esm.html" method="get">
    <fieldset>
      <legend>Contact details</legend>
      <label>Your name
        <input name="name" autocomplete="name" required />
      </label>
    </fieldset>
    <fieldset>
      <legend>Delivery notes</legend>
      <label>Notes <textarea name="notes"></textarea></label>
    </fieldset>
    <button type="submit">Send application</button>
  </form>
</form-fieldset-progress>

<script type="module">
import { FormFieldsetProgressElement } from
  'https://esm.sh/@aarongustafson/form-fieldset-progress@1.1.0/form-fieldset-progress.js?bundle&target=es2022';

if (!customElements.get('form-fieldset-progress')) {
  customElements.define(
    'form-fieldset-progress',
    FormFieldsetProgressElement,
  );
}
</script>
Contact details
Delivery notes