Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Hyperform is a complete implementation of the HTML 5 form validation API in Javascript. It replaces the browser’s native methods (if it even implements them…) and enriches it with custom events and hooks.
The easiest way is installing via npm
:
npm install hyperform
Or download the current version as ZIP archive.
Then embed dist/hyperform.min.js
in your file:
<script src="path/to/hyperform/dist/hyperform.min.js"></script>
The library introduces the global variable hyperform
. You can let Hyperform
take over a single form:
hyperform.capture(document.forms[0]);
or all forms, current and future ones:
hyperform.capture(document);
If you need only a certain feature, you can access it directly by name:
hyperform.setCustomValidity.call(form.elements[0], 'my message');
What parts of the HTML5 validation API are ready for prime time?
feature | status | comment |
---|---|---|
willValidate | :full_moon: | |
setCustomValidity(message) | :full_moon: | |
validity.valueMissing | :full_moon: | |
validity.typeMismatch | :full_moon: | |
validity.patternMismatch | :full_moon: | |
validity.tooLong | :full_moon: | |
validity.tooShort | :full_moon: | |
validity.rangeUnderflow | :full_moon: | |
validity.rangeOverflow | :full_moon: | |
validity.stepMismatch | :last_quarter_moon: | Step validation for type=month is incorrect, yet |
validity.badInput | :waning_gibbous_moon: | Works for all but type=email . (That last one might be unfixable. See comment in src/validators/bad_input.js.) |
validity.customError | :full_moon: | |
validity.valid | :waning_gibbous_moon: | Depends on the other validations above. Apart from that, finished. |
checkValidity() | :waning_gibbous_moon: | Depends on ValidityState . Apart from that, finished. |
reportValidity() | :last_quarter_moon: | Depends on ValidityState . Needs a bit more love for the error message renderer. Will render error, even if invalid event is cancelled. |
validationMessage | :full_moon: | |
valueAsDate | :full_moon: | |
valueAsNumber | :full_moon: | |
valueLow / valueHigh | :new_moon: | not started, yet |
stepUp(n) / stepDown(n) | :new_moon: | not started, yet |
accept attribute | :new_moon: | for type=file inputs. Is it useful to implement a check here? There are browsers without support here, that implement the File API. So we could totally do it. |
support for novalidate | :new_moon: |
What parts of the high-level API are finished?
validate
event before validating an element.valid
event, when an input becomes valid, again.validity.customError
step.submit
event to do our own
validation (click
s on submit buttons and enter
keys in text inputs in
forms w/o submit buttons).valid
and invalid
as well as proper
aria-invalid
to elements to become independent of :valid
/ :invalid
pseudo-classes.<input>
elements out of validation (think
novalidate
attribute for inputs).Do you have a wish or an idea? File an issue and let us discuss it!
This library is released under the terms of the MIT license.
v0.1.7
_original_method
FAQs
Capture form validation back from the browser
The npm package hyperform receives a total of 12,763 weekly downloads. As such, hyperform popularity was classified as popular.
We found that hyperform demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.