Class: Autosubmit

Autosubmit()

<brut-autosubmit>

When the value of the wrapped form element(s) fire(s) a change event, the form is submitted. This will only work if it is inside a form and the form elements it contains are part of the form. That means if your input/textarea/select uses the form attribute, this custom element has no effect.

Constructor

new Autosubmit()

Source:
Example
<form>
  <brut-autosubmit>
    <!-- when a selection is made, the form is submitted -->
    <select name="status">
      <option value="draft">Draft</option>
      <option value="ready">Ready</option>
      <option value="published">Published</option>
    </select>
  </brut-autosubmit>
  <!-- when the value is changed, form is NOT submitted -->
  <input type="text" value="notes">
  <button>Save</button>
</form>