The Wayback Machine - https://web.archive.org/web/20180627075016/https://github.com/github/auto-check-element
Skip to content
An input element that validates its value with a server endpoint.
JavaScript
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

<auto-check> element

An input element that validates its value against a server endpoint.

Installation

$ npm install --save auto-check-element

Usage

import 'auto-check-element'
<auto-check src='/signup_check/username' csrf="<%= authenticity_token_for("/signup_check/username") %>">
 <input></input>
</auto-check>

Provide a URL and a CSRF token and the autocheck component will show validation confirmations and validation errors.

The endpoint should return:

  • a 200 HTTP status code if the provided value if valid.
  • a 422 HTTP status code if the provided value is invalid.
  • a optional error message in the body and a Content-Type header with a value of text/html; fragment.

Browser support

  • Chrome
  • Firefox
  • Safari 9+
  • Internet Explorer 11
  • Microsoft Edge

Development

Clone this repository and run the following to install the dependencies and run the tests.

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.