<script> var options = { onFail: function() { alert( $myform.getInvalid().length +' invalid fields.' ) }, inputs: { 'password': { filters: 'required pass', }, 'username': { filters: 'required username', data: { //ajax: { url:'validate.php' } } }, 'file': { filters: 'extension', data: { extension: ['jpg'] } }, 'comments': { filters: 'min max', data: { min: 50, max: 200 } }, 'states': { filters: 'exclude', data: { exclude: ['default'] }, errors : { exclude: 'Select a State.' } }, 'langs[]': { filters: 'min max', data: { min: 2, max: 3 }, errors: { min: 'Check at least 2 options.', max: 'No more than 3 options allowed.' } } } }; var $myform = $('#my-form').idealforms(options).data('idealforms'); $('#reset').click(function(){ $myform.reset().fresh().focusFirst() }); $myform.focusFirst(); </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)