Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@github/auto-check-element
Advanced tools
An input element that validates its value with a server endpoint.
An input element that validates its value against a server endpoint.
$ npm install --save @github/auto-check-element
import '@github/auto-check-element'
<auto-check src="/signup_check/username" csrf="<%= authenticity_token_for("/signup_check/username") %>">
<input>
</auto-check>
Provide a URL and a CSRF token and the autocheck component will show validation confirmations and validation errors.
The endpoint should respond to POST requests with:
Content-Type
header with a value of text/html; fragment
.const check = document.querySelector('auto-check')
// Network request lifecycle events.
check.addEventListener('loadstart', function(event) {
console.log('Network request started', event)
})
check.addEventListener('loadend', function(event) {
console.log('Network request complete', event)
})
check.addEventListener('load', function(event) {
console.log('Network request succeeded', event)
})
check.addEventListener('error', function(event) {
console.log('Network request failed', event)
})
// Auto-check result events.
const input = check.querySelector('input')
input.addEventListener('auto-check-send', function(event) {
console.log('Adding to FormData before network request is sent.')
const {body} = event.detail
body.append('custom_form_data', 'value')
})
input.addEventListener('auto-check-success', function(event) {
const {message} = event.detail
console.log('Validation passed', message)
})
input.addEventListener('auto-check-error', function(event) {
const {message} = event.detail
console.log('Validation failed', message)
})
input.addEventListener('auto-check-complete', function(event) {
console.log('Validation complete', event)
})
Browsers without native custom element support require a polyfill.
npm install
npm test
Distributed under the MIT license. See LICENSE for details.
FAQs
An input element that validates its value with a server endpoint.
We found that @github/auto-check-element demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.