Browse Source

Adds clear events on clear buttons

pull/1729/head
jlukic 9 years ago
parent
commit
8a2ba42d4d
1 changed files with 6 additions and 0 deletions
  1. 6
      src/definitions/behaviors/form.js

6
src/definitions/behaviors/form.js

@ -45,7 +45,9 @@ $.fn.form = function(fields, parameters) {
$group = $(this).find(selector.group), $group = $(this).find(selector.group),
$message = $(this).find(selector.message), $message = $(this).find(selector.message),
$prompt = $(this).find(selector.prompt), $prompt = $(this).find(selector.prompt),
$submit = $(this).find(selector.submit), $submit = $(this).find(selector.submit),
$clear = $(this).find(selector.clear),
$reset = $(this).find(selector.reset), $reset = $(this).find(selector.reset),
formErrors = [], formErrors = [],
@ -115,9 +117,12 @@ $.fn.form = function(fields, parameters) {
$field $field
.on('blur' + eventNamespace, module.event.field.blur) .on('blur' + eventNamespace, module.event.field.blur)
; ;
// attach events to common elements // attach events to common elements
module.attachEvents($submit, 'submit'); module.attachEvents($submit, 'submit');
module.attachEvents($reset, 'reset'); module.attachEvents($reset, 'reset');
module.attachEvents($clear, 'clear');
$field $field
.each(function() { .each(function() {
var var
@ -867,6 +872,7 @@ $.fn.form.settings = {
selector : { selector : {
checkbox : 'input[type="checkbox"], input[type="radio"]', checkbox : 'input[type="checkbox"], input[type="radio"]',
clear : '.clear',
field : 'input, textarea, select', field : 'input, textarea, select',
group : '.field', group : '.field',
input : 'input', input : 'input',

Loading…
Cancel
Save