Form validation

back edit

Invalidate form unless input value is changed.

<form>
  <label class="d-block">
    <input type="radio" value="public" name="visibility" data-required-change checked> Public
  </label>
  <label class="d-block">
    <input type="radio" value="private" name="visibility" data-required-change> Private
  </label>
  <button class="btn mt-2" type="submit">Submit</button>
</form>

On change, toggle the submitbutton according to form validity.

<form>
  <textarea required class="width-full mb-2 form-control"></textarea>
  <button class="btn" type="submit" data-disable-invalid>Submit</button>
</form>

Disable submit unless input value is changed.

<form>
  <input type="text" value="Hello" data-required-change class="mr-1 form-control">
  <button class="btn" type="submit" data-disable-invalid>Submit</button>
</form>