JavaScript Form Validation.
Made Easy
Use standard HTML to enable form superpowers.
Need only basic powers? Try Lite version.
Version
Only 7.6KB ( Lite version 3.5KB ) minified & gzipped
Download Latest Version | All Releases
formJS is compatible with ( desktop & mobile versions ):
* for compatibility with IE, old versions of Edge and/or other old browsers you may need to load some JS polyfills ( from polyfill.io or else ):
Array.from Element.prototype.closest Element.prototype.matches Promise Promise.prototype.finally AbortController fetch CustomEvent
<script src="https://cdn.polyfill.io/v3/polyfill.min.js?features=Array.from,Element.prototype.closest,Element.prototype.matches,Promise,Promise.prototype.finally,AbortController,fetch,CustomEvent"></script>
* for Lite version you may need these polyfills:
Array.from Element.prototype.closest Element.prototype.matches Promise CustomEvent
formJS is now available on jsDelivr CDN.
formJS is now available in 2 versions ( the difference is only about the API used for AJAX calls ):
Many relevant changes from the previous version:
data-type="number" to emulate type="number" inputs ( see "strictHtmlValidation" option in Field Options section for details ).
If you find a bug, please report it here