mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: Disable autocomplete on ConfirmedPasswordField instances.
This commit is contained in:
parent
09fcdb8c31
commit
94d6b1ccff
@ -95,6 +95,12 @@ class ConfirmedPasswordField extends FormField {
|
|||||||
if($showOnClick) {
|
if($showOnClick) {
|
||||||
$this->children->push(new HiddenField("{$name}[_PasswordFieldVisible]"));
|
$this->children->push(new HiddenField("{$name}[_PasswordFieldVisible]"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// disable auto complete
|
||||||
|
foreach($this->children as $child) {
|
||||||
|
$child->setAttribute('autocomplete', 'off');
|
||||||
|
}
|
||||||
|
|
||||||
$this->showOnClick = $showOnClick;
|
$this->showOnClick = $showOnClick;
|
||||||
|
|
||||||
// we have labels for the subfields
|
// we have labels for the subfields
|
||||||
@ -136,11 +142,13 @@ class ConfirmedPasswordField extends FormField {
|
|||||||
foreach($this->children as $field) {
|
foreach($this->children as $field) {
|
||||||
$field->setDisabled($this->isDisabled());
|
$field->setDisabled($this->isDisabled());
|
||||||
$field->setReadonly($this->isReadonly());
|
$field->setReadonly($this->isReadonly());
|
||||||
|
|
||||||
if(count($this->attributes)) {
|
if(count($this->attributes)) {
|
||||||
foreach($this->attributes as $name => $value) {
|
foreach($this->attributes as $name => $value) {
|
||||||
$field->setAttribute($name, $value);
|
$field->setAttribute($name, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$content .= $field->FieldHolder();
|
$content .= $field->FieldHolder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
(function ($) {
|
(function ($) {
|
||||||
$('.confirmedpassword .showOnClick a').live('click', function () {
|
$(document).on('click', '.confirmedpassword .showOnClick a', function () {
|
||||||
var $container = $('.showOnClickContainer', $(this).parent());
|
var $container = $('.showOnClickContainer', $(this).parent());
|
||||||
|
|
||||||
$container.toggle('fast', function() {
|
$container.toggle('fast', function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user