Browse Source

removeMaskOnSubmit has no reason to depend on autoUnmask #709

Robin Herbots 11 years ago
parent
commit
538c5523e0

+ 0 - 1
README.md

@@ -427,7 +427,6 @@ Default: false.
 
 
 #### removeMaskOnSubmit
 #### removeMaskOnSubmit
 Remove the mask before submitting the form.  
 Remove the mask before submitting the form.  
-Use in combination with autoUnmask: true
 
 
 #### clearMaskOnLostFocus
 #### clearMaskOnLostFocus
 
 

+ 1 - 1
dist/inputmask/jquery.inputmask.js

@@ -860,7 +860,7 @@
                 }
                 }
                 $el.unbind(".inputmask"), $el.closest("form").bind("submit", function() {
                 $el.unbind(".inputmask"), $el.closest("form").bind("submit", function() {
                     valueOnFocus != getBuffer().join("") && $el.change(), $el[0]._valueGet && $el[0]._valueGet() == getBufferTemplate().join("") && $el[0]._valueSet(""), 
                     valueOnFocus != getBuffer().join("") && $el.change(), $el[0]._valueGet && $el[0]._valueGet() == getBufferTemplate().join("") && $el[0]._valueSet(""), 
-                    opts.autoUnmask && opts.removeMaskOnSubmit && $el.inputmask("remove");
+                    opts.removeMaskOnSubmit && $el.inputmask("remove");
                 }).bind("reset", function() {
                 }).bind("reset", function() {
                     setTimeout(function() {
                     setTimeout(function() {
                         $el.trigger("setvalue");
                         $el.trigger("setvalue");

+ 1 - 1
dist/jquery.inputmask.bundle.js

@@ -858,7 +858,7 @@
                 }
                 }
                 $el.unbind(".inputmask"), $el.closest("form").bind("submit", function() {
                 $el.unbind(".inputmask"), $el.closest("form").bind("submit", function() {
                     valueOnFocus != getBuffer().join("") && $el.change(), $el[0]._valueGet && $el[0]._valueGet() == getBufferTemplate().join("") && $el[0]._valueSet(""), 
                     valueOnFocus != getBuffer().join("") && $el.change(), $el[0]._valueGet && $el[0]._valueGet() == getBufferTemplate().join("") && $el[0]._valueSet(""), 
-                    opts.autoUnmask && opts.removeMaskOnSubmit && $el.inputmask("remove");
+                    opts.removeMaskOnSubmit && $el.inputmask("remove");
                 }).bind("reset", function() {
                 }).bind("reset", function() {
                     setTimeout(function() {
                     setTimeout(function() {
                         $el.trigger("setvalue");
                         $el.trigger("setvalue");

File diff suppressed because it is too large
+ 1 - 1
dist/jquery.inputmask.bundle.min.js


+ 2 - 2
js/jquery.inputmask.js

@@ -1601,7 +1601,7 @@
                         if ($el[0]._valueGet && $el[0]._valueGet() == getBufferTemplate().join('')) {
                         if ($el[0]._valueGet && $el[0]._valueGet() == getBufferTemplate().join('')) {
                             $el[0]._valueSet(''); //clear masktemplete on submit and still has focus
                             $el[0]._valueSet(''); //clear masktemplete on submit and still has focus
                         }
                         }
-                        if (opts.autoUnmask && opts.removeMaskOnSubmit) {
+                        if (opts.removeMaskOnSubmit) {
                             $el.inputmask("remove");
                             $el.inputmask("remove");
                         }
                         }
                     }).bind('reset', function () {
                     }).bind('reset', function () {
@@ -1900,7 +1900,7 @@
                 repeat: 0, //repetitions of the mask: * ~ forever, otherwise specify an integer
                 repeat: 0, //repetitions of the mask: * ~ forever, otherwise specify an integer
                 greedy: true, //true: allocated buffer for the mask and repetitions - false: allocate only if needed
                 greedy: true, //true: allocated buffer for the mask and repetitions - false: allocate only if needed
                 autoUnmask: false, //automatically unmask when retrieving the value with $.fn.val or value if the browser supports __lookupGetter__ or getOwnPropertyDescriptor
                 autoUnmask: false, //automatically unmask when retrieving the value with $.fn.val or value if the browser supports __lookupGetter__ or getOwnPropertyDescriptor
-                removeMaskOnSubmit: true, //remove the mask before submitting the form.  Use in combination with autoUnmask: true
+                removeMaskOnSubmit: true, //remove the mask before submitting the form.
                 clearMaskOnLostFocus: true,
                 clearMaskOnLostFocus: true,
                 insertMode: true, //insert the input or overwrite the input
                 insertMode: true, //insert the input or overwrite the input
                 clearIncomplete: false, //clear the incomplete input on blur
                 clearIncomplete: false, //clear the incomplete input on blur