Skip to content

Commit 94d6b1c

Browse files
committed
FIX: Disable autocomplete on ConfirmedPasswordField instances.
1 parent 09fcdb8 commit 94d6b1c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

forms/ConfirmedPasswordField.php

+8
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ public function __construct($name, $title = null, $value = "", $form = null, $sh
9595
if($showOnClick) {
9696
$this->children->push(new HiddenField("{$name}[_PasswordFieldVisible]"));
9797
}
98+
99+
// disable auto complete
100+
foreach($this->children as $child) {
101+
$child->setAttribute('autocomplete', 'off');
102+
}
103+
98104
$this->showOnClick = $showOnClick;
99105

100106
// we have labels for the subfields
@@ -136,11 +142,13 @@ public function Field($properties = array()) {
136142
foreach($this->children as $field) {
137143
$field->setDisabled($this->isDisabled());
138144
$field->setReadonly($this->isReadonly());
145+
139146
if(count($this->attributes)) {
140147
foreach($this->attributes as $name => $value) {
141148
$field->setAttribute($name, $value);
142149
}
143150
}
151+
144152
$content .= $field->FieldHolder();
145153
}
146154

javascript/ConfirmedPasswordField.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(function ($) {
2-
$('.confirmedpassword .showOnClick a').live('click', function () {
2+
$(document).on('click', '.confirmedpassword .showOnClick a', function () {
33
var $container = $('.showOnClickContainer', $(this).parent());
44

55
$container.toggle('fast', function() {

0 commit comments

Comments
 (0)