Skip to content

Commit 2030037

Browse files
committed
modify password clone to password type right on submit to prevent the browser remind the content
1 parent 794ed99 commit 2030037

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

core/js/jquery-showpassword.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,16 @@
103103
$clone.bind('blur', function() { $input.trigger('focusout'); });
104104

105105
setState( $checkbox, $input, $clone );
106-
106+
107+
// set type of password field clone (type=text) to password right on submit
108+
// to prevent browser save the value of this field
109+
$clone.closest('form').submit(function(e) {
110+
// .prop has to be used, because .attr throws
111+
// an error while changing a type of an input
112+
// element
113+
$clone.prop('type', 'password');
114+
});
115+
107116
if( callback.fn ){
108117
callback.fn( callback.args );
109118
}

0 commit comments

Comments
 (0)