From 38941a61bf105a601200e378409bc2078a070994 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Sun, 7 Apr 2013 21:51:10 +0200 Subject: [PATCH 1/2] turn off autocompletion for password field refs #2632 --- core/js/jquery-showpassword.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/js/jquery-showpassword.js b/core/js/jquery-showpassword.js index 0f4678327a3..9cdc48efe89 100644 --- a/core/js/jquery-showpassword.js +++ b/core/js/jquery-showpassword.js @@ -35,7 +35,8 @@ 'style' : $element.attr('style'), 'size' : $element.attr('size'), 'name' : $element.attr('name')+'-clone', - 'tabindex' : $element.attr('tabindex') + 'tabindex' : $element.attr('tabindex'), + 'autocomplete' : 'off' }); return $clone; From 938b12236ad934c9222b9c4fd2d1beaf9a0a4418 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 19 Apr 2013 10:06:18 +0200 Subject: [PATCH 2/2] modify password clone to password type right on submit to prevent the browser remind the content --- core/js/jquery-showpassword.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 ); }