{"repo":"github/auto-check-element","free":true,"listed":false,"github":"https://github.com/github/auto-check-element","clone":"git clone https://github.com/github/auto-check-element.git","description":"An input element that validates its value with a server endpoint.","language":"JavaScript","stars":188,"topics":["web-components","custom-elements"],"license":"MIT","category":"ui-components","readme_excerpt":"&lt;auto-check&gt; element An input element that validates its value against a server endpoint. Installation Usage Script Import as a modules: With a script tag: Markup Note that in the following example the CSRF element is marked with the data-csrf attribute rather than name so that the value doesn't get posted to the backend when the element is placed in a form. Attributes - src is the server endpoint that will receive POST requests. The posted form contains a value parameter containing the text input to validate. Responding with a 200 OK status indicates the provided value is valid. Any other error status response indicates the provided value is invalid. - csrf is the [CSRF][] token for the posted form. It's available in the request body as a authenticity token form parameter. - You can also supply the CSRF token via a child element. See usage example. - required is a boolean attribute that requires the validation to succeed before the surrounding form may be submitted. - http-method defaults to POST where data is submitted as a POST with form data. You can set GET and the HTTP method used will be a get with url encoded params instead. Events Network request lifecycle events Request lifecycle events are dispatched on the element. These events do not bubble. - loadstart - The server fetch has started. - load - The network request completed successfully. - error - The network request failed. - loadend - The network request has completed. Network events are useful for display","default_branch":null,"files":null,"tree":[],"storefront":"/r/github","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/github/auto-check-element/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}