
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
form-part-validator
Advanced tools
The validator allows you to specify easily what each input should contain to be valid you can then watch for errors :
The validator allows you to specify easily what each input should contain to be valid you can then watch for errors :
import Validator from "./validator.js";
const validator = new Validator();
validator.watch(document.querySelectorAll("input"));
you simply add a keyword to it's data-form-constraints attribute, separated by spaces :
<input type="text" name="foo" data-form-constraints="length:0:38 nodot nowhitespace nonumber">
this will, when using the watch function, produce an error badge when the input doesn't match it's constraints
| name | function | usage |
|---|---|---|
| length | assert length between min and max | length:min:max |
| minLength | assert minimum length | minLength:min |
| maxLength | assert maximum length | maxLength:max |
| text | assert value contains some text | text |
| uppercase | assert value is uppercase | uppercase |
| lowercase | assert value is lowercase | lowercase |
| number | assert value is numbers | number |
| nodot | assert value has not dots | nodot |
| nowhitespace | assert value whitspace | nowhitespace |
| nonumber | assert value contains no numbers | nonumber |
| assert value looks like an email | ||
| dateInPast | assert the date is x years:months:days in the past | dateInPast:year:month:day |
| dateInFuture | assert the date is x years:months:days in the future | dateInPast:year:month:day |
the name attribute is necessary for error messages to work properly
FAQs
The validator allows you to specify easily what each input should contain to be valid you can then watch for errors :
We found that form-part-validator 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.