diff --git a/README.md b/README.md index cf3e744..fef1819 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,14 @@ input.addEventListener('auto-check-complete', function(event) { [CSRF]: https://en.wikipedia.org/wiki/Cross-site_request_forgery [Response]: https://developer.mozilla.org/en-US/docs/Web/API/Response +## Manually Trigger Validation + +The `triggerValidation()` function can be used to manually trigger the `` element. + +```js +document.getElementById('input-element').closest('auto-check').triggerValidation() +``` + ## Browser support Browsers without native [custom element support][support] require a [polyfill][]. diff --git a/custom-elements.json b/custom-elements.json index 3ab9ad2..fed53b6 100644 --- a/custom-elements.json +++ b/custom-elements.json @@ -155,6 +155,15 @@ "kind": "field", "name": "onloadend" }, + { + "kind": "method", + "name": "triggerValidation", + "return": { + "type": { + "text": "void" + } + } + }, { "kind": "field", "name": "input", diff --git a/examples/index.html b/examples/index.html index 5132f69..2986fe8 100644 --- a/examples/index.html +++ b/examples/index.html @@ -108,7 +108,7 @@