summaryrefslogtreecommitdiffstats
path: root/core/js/jquery-showpassword.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/jquery-showpassword.js')
-rw-r--r--core/js/jquery-showpassword.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/js/jquery-showpassword.js b/core/js/jquery-showpassword.js
index 9cdc48efe89..e1737643b48 100644
--- a/core/js/jquery-showpassword.js
+++ b/core/js/jquery-showpassword.js
@@ -103,7 +103,16 @@
$clone.bind('blur', function() { $input.trigger('focusout'); });
setState( $checkbox, $input, $clone );
-
+
+ // set type of password field clone (type=text) to password right on submit
+ // to prevent browser save the value of this field
+ $clone.closest('form').submit(function(e) {
+ // .prop has to be used, because .attr throws
+ // an error while changing a type of an input
+ // element
+ $clone.prop('type', 'password');
+ });
+
if( callback.fn ){
callback.fn( callback.args );
}