0.0.71 • Published 9 years ago
civem v0.0.71
Custom Input Validation Error Messages
HTML5 form validation error messages are hard-coded to the browser. Civem.js lets you easily change them to whatever you wish. For translation or consistency with your server-side error messages. Civem.js does not depend on any library or framework, so you can use it without a doubt.
Quick Start
- Grab the latest download
- Add the civem.js script to your page
- Start using the custom error message attributes on your
input,textareaandselectelements
API
Any input, textarea or select element may contain:
data-errormessagea generic error message
Validity state specific error messages:
data-errormessage-value-missingdata-errormessage-type-mismatchdata-errormessage-pattern-mismatchdata-errormessage-too-longdata-errormessage-range-underflowdata-errormessage-range-overflowdata-errormessage-step-mismatchdata-errormessage-custom-error
Demo
At jsFiddle.
Tested on
- Firefox 17.0.1
- Chrome 23.0.1271.97