validator.js
validator.js copied to clipboard
Client side validation?
I want to use validator.js for client-side validation as well but couldn't locate document/example for same. Any help in this regards is much appreciated.
There is already a validator.js package for client side validations that does point to this package.
For the latest version: https://unpkg.com/validator@latest/validator.min.js Or you can use specific version, just change version tag (latest) from the link.
Usage:
<script type="text/javascript" src="https://unpkg.com/[email protected]/validator.min.js"></script>
<script type="text/javascript">
console.log(validator.isEmail('[email protected]')); // true
</script>
https://github.com/validatorjs/validator.js#client-side-usage
https://github.com/validatorjs/validator.js/blob/86a07ba4f3f710f639e92a62cf81dd3321ef9ee8/README.md#L53-L74
@girishpadia Does that answer your question? If so, could you close the issue please?
Thanks!
Yes it answers my question. Thank You. :+1: