diff --git a/source/Ox.UI/js/Form/Ox.Input.js b/source/Ox.UI/js/Form/Ox.Input.js index bb191680..eb41df4c 100644 --- a/source/Ox.UI/js/Form/Ox.Input.js +++ b/source/Ox.UI/js/Form/Ox.Input.js @@ -596,6 +596,15 @@ Ox.Input = function(options, self) { self.options.placeholder && setPlaceholder(); self.options.validate && validate(); self.bindKeyboard && Ox.UI.$document.unbind('keydown', keydown); + if (!self.cancelled && !self.submitted) { + that.triggerEvent('blur', { + value: self.options.value + }); + self.options.value !== self.originalValue && that.triggerEvent('change', { + value: self.options.value + }); + } + /* self.options.value !== self.originalValue && that.triggerEvent('change', { value: self.options.value }); @@ -604,17 +613,20 @@ Ox.Input = function(options, self) { !self.cancelled && !self.submitted && that.triggerEvent('blur', { value: self.options.value }); + */ } function cancel() { self.cancelled = true; - self.$input.blur().val(self.originalValue); + self.$input.val(self.originalValue).blur(); self.cancelled = false; that.triggerEvent('cancel'); } function change() { + // change gets invoked before blur self.options.value = self.$input.val(); + self.originalValue = self.options.value; that.triggerEvent('change', { value: self.options.value });