Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drwpow/html5-form
< 1kb JS-fallback for HTML5-style validation
https://github.com/drwpow/html5-form
Last synced: 9 days ago
JSON representation
< 1kb JS-fallback for HTML5-style validation
- Host: GitHub
- URL: https://github.com/drwpow/html5-form
- Owner: drwpow
- Created: 2012-08-21T15:40:10.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-09-07T16:56:24.000Z (over 12 years ago)
- Last Synced: 2024-10-15T00:39:41.477Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
HTML5-Form
==========JS-fallback for HTML5-style validation (version 0.2)
Description
-----------
This is a JS fallback for IE8 / IE9 to use HTML5 form validation, and requires no modification to your forms. It requires all elements with a `required` attribute to be filled out and validate.It validates based on an input's `type` attribute. Currently it only supports email validation.
Currently unsupported, planned for upcoming releases:
* `tel`
* `radio`
* `checkbox`Dependencies
------------
- jQueryUsage
-----
To initialize:$(document).ready(function() {
$('form').html5form();
});It will then require every input element with a `required` attribute to be filled out and pass validation.
The selector can be a form element, or any other element that contains the elements to be validated.
Options
-------
* `email` - The default error message for an invalid email (default: `Please enter a valid email address`)
* `empty` - The default error message for an empty element (default: `Please fill out this field`)
* `errorClass` - CSS class hook for error messages (default: `error`)
* `errorID` - ID prefix to apply to error messages (default: `errormsg`)
* `invalidClass` - CSS class hook for invalid form elements (default: `invalid`)
* `invalidCSS` - inline style to apply to invalid form elements (default: `{boxShadow: '0 0 4px #f20'}`)
* `showErrors` - set to `1` or `true` to display form errors; set to `0` or `false` to hide them (default: `true`)
* `validCSS` - inline style to override the `invalidCSS` setting (default: `{boxShadow: 'none'`)Download
--------
https://github.com/dangodev/HTML5-Form/zipball/master