
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.
validator-lite
Advanced tools
Lightweight Form Validation (no dependencies)
$ npm install --save validator-lite
<form id="demo">
<div class="form-control">
<label>Email Address</label>
<input type="email" name="email">
</div>
<div class="form-control">
<label>Password</label>
<input id="pw" type="password" name="password1">
</div>
<div class="form-control">
<label>Confirm Password</label>
<input type="password" name="password2">
</div>
<button type="submit">Register</button>
</form>
<script src="validator.min.js"></script>
<script>
var demo = document.getElementById('demo');
var val = new Validator({
form: demo,
fieldClass: 'form-control',
rules: {
email: {
required: true,
message: 'You must enter an email',
test: 'email'
},
password1: {
required: true,
message: 'You must enter a password',
test: 'password'
},
password2: {
required: true,
test: 'equals'
message: 'Please confirm your password',
arg: function () {
return demo.querySelector('input#pw').value;
}
},
},
onFail: function () {
alert('Please correct all errors!');
},
onPass: function (elem) {
elem.reset();
window.location.href = '/welcome';
}
});
</script>
Add custom tests or override included defaults.
Type: Element
Default: null
Lorem ipsum.
Type: Object
Default: {}
Lorem ipsum.
Type: String
Default: 'error'
Lorem ipsum.
Type: String
Default: 'Required'
Lorem ipsum.
Type: Function
Default: noop
Lorem ipsum.
Type: Function
Default: noop
Lorem ipsum.
MIT © Luke Edwards
FAQs
Lightweight Form Validation (no dependencies)
We found that validator-lite 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.