From 8a2ba42d4d3775a3676efc5b873ca96533f235a7 Mon Sep 17 00:00:00 2001 From: jlukic Date: Fri, 23 Jan 2015 16:39:53 -0500 Subject: [PATCH] Adds clear events on clear buttons --- src/definitions/behaviors/form.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/definitions/behaviors/form.js b/src/definitions/behaviors/form.js index 0a155c455..d61860761 100644 --- a/src/definitions/behaviors/form.js +++ b/src/definitions/behaviors/form.js @@ -45,7 +45,9 @@ $.fn.form = function(fields, parameters) { $group = $(this).find(selector.group), $message = $(this).find(selector.message), $prompt = $(this).find(selector.prompt), + $submit = $(this).find(selector.submit), + $clear = $(this).find(selector.clear), $reset = $(this).find(selector.reset), formErrors = [], @@ -115,9 +117,12 @@ $.fn.form = function(fields, parameters) { $field .on('blur' + eventNamespace, module.event.field.blur) ; + // attach events to common elements module.attachEvents($submit, 'submit'); module.attachEvents($reset, 'reset'); + module.attachEvents($clear, 'clear'); + $field .each(function() { var @@ -867,6 +872,7 @@ $.fn.form.settings = { selector : { checkbox : 'input[type="checkbox"], input[type="radio"]', + clear : '.clear', field : 'input, textarea, select', group : '.field', input : 'input',