validator.js icon indicating copy to clipboard operation
validator.js copied to clipboard

Client side validation?

Open girishpadia opened this issue 2 years ago • 2 comments

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.

girishpadia avatar Aug 28 '22 07:08 girishpadia

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>

seabeya avatar Aug 29 '22 07:08 seabeya

https://github.com/validatorjs/validator.js#client-side-usage

https://github.com/validatorjs/validator.js/blob/86a07ba4f3f710f639e92a62cf81dd3321ef9ee8/README.md#L53-L74

WikiRik avatar Sep 02 '22 20:09 WikiRik

@girishpadia Does that answer your question? If so, could you close the issue please?

Thanks!

pano9000 avatar Dec 08 '22 13:12 pano9000

Yes it answers my question. Thank You. :+1:

girishpadia avatar Dec 10 '22 12:12 girishpadia