This is part of Javascript Form Utilities that I developed to make form validation with js become easier.
Tired of licenses
Validator.Form('#form_id', {
// simple style 'input name' + 'array'
firstname: {
rules: ['required']
}
email: {
rules: ['email']
}
// more custom style 'input name' + 'object'
email_confirm: {
rules: {
email: true,
match: '#email' // make sure it match with 'email'
}
},
password: {
rules: {
required: function() {
// custom validation
}
}
},
// working with radios, checkboxes and multiple selects
choices: {
rules: {
required: true // normally you don't have to add 'required' rule since all elements defined here has a required by default
}
},
});
- handle dynamic dom