Skip to content

Latest commit

 

History

History
76 lines (66 loc) · 2.57 KB

index.md

File metadata and controls

76 lines (66 loc) · 2.57 KB
id title
home
Capture form validation back from the browser

Hyperform is a complete implementation of the HTML 5 form validation API in Javascript. It replaces or polyfills the browser’s native methods and eases your validation task with custom events and hooks.

Hyperform is neatly packed in a single Javascript file, weights only {{site.filesize_plain}}kB ({{site.filesize_gzipped}}kB gzipped!) and includes:

  • a full, working and compliant implementation of the whole HTML 5 constraint API

    assert(input.validity.valid);
  • polyfills and ponyfills for other useful methods like valueAsNumber or stepUp

    // polyfill:
    assert(input.valueAsNumber === 123);
    
    // ponyfill:
    hyperform.stepUp(input); // instead of input.stepUp()
  • new events

    form.addEventListener('validate', function(event) {
      // stop the engines!
      event.preventDefault();
    });
  • easily customizable error messages

    <input required data-value-missing="No chance! Fill it already.">
  • fine-grained control over the display of messages

    .hf_warning {
      border-color: pink;
    }
  • and all this licensed under the terms of the MIT license