Performs different tests on forms and highlight errors.
Usage
Works with these types of fields :
- input (text, radio, checkbox)
- textarea
- select
You just need to add classes to fields you want to be checked (at least the ‘required’ class). Avalaible test are :
- required
- phone
- digit
- minchar (2 characteres at least)
- email
Parameters
| form_id | The id of the formular. By default it is ‘mainform’. |
| error_class | The class to apply to fields with error. By default it is ‘error_f’ |
| highlight | Choose if you want to highlight errors. 0 : highlight none, 1 : highlight one, 2 : highlight all. By default it is 1. |
| scroll_to_error | Smooth scroll the page to first error, by default it is set on true. |
Exemple
You can initialize a formcheck by adding this in your html head this code :
<script type="text/javascript">
window.addEvent('domready', function() {
var myFormCheck = new FormCheck({
form_id : 'mainform',
error_class : 'error_f',
highlight : 2,
scroll_to_error : false
});
});
</script>
About
simplecheck.js v.1.0 for mootools v1.1 05 / 2007
by Floor SA (http://www.floor.ch) MIT-style license
Created by Luca Pillonel and David Mignot, last modified by Luca Pillonel 30.05.12
Summary
| Performs different tests on forms and highlight errors. |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |