1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-22 22:34:15 +02:00

Add request processwire/processwire-issues#614 to make InputfieldPassword use version of id attribute for confirm input rather than name attribute, for cases where someone might want to have multiple password fields in the same document.

This commit is contained in:
Ryan Cramer
2018-08-08 14:48:10 -04:00
parent 9fc4ff9e21
commit 82641a5521

View File

@@ -205,6 +205,7 @@ class InputfieldPassword extends InputfieldText {
$newPassLabel = $this->_('New password');
$confirmLabel = $this->_('Confirm');
$name = $this->attr('name');
$id = $this->attr('id');
$size = $this->attr('size');
$out = '';
@@ -219,7 +220,7 @@ class InputfieldPassword extends InputfieldText {
$out .=
"<p class='InputfieldPasswordRow'>" .
"<label for='$this->id'>$newPassLabel</label>" .
"<label for='$id'>$newPassLabel</label>" .
"<input placeholder='$newPassLabel' " . $this->getAttributesString() . " /> " .
"<span class='detail pass-scores' data-requirements='" . implode(' ', array_keys($requirements)) . "'>" .
//"<span class='on'>$angleIcon$newPassLabel</span>" .
@@ -235,9 +236,9 @@ class InputfieldPassword extends InputfieldText {
"</span>" .
"</p>" .
"<p class='InputfieldPasswordRow'>" .
"<label for='_$name'>$confirmLabel</label>" .
"<label for='_$id'>$confirmLabel</label>" .
"<input placeholder='$confirmLabel' class='InputfieldPasswordConfirm $inputClass' type='password' " .
"size='$size' id='_$name' name='_$name' value='$confirmValue' autocomplete='new-password' /> " .
"size='$size' id='_$id' name='_$name' value='$confirmValue' autocomplete='new-password' /> " .
"<span class='pass-confirm detail'>" .
//"<span class='confirm-pending on'>$angleIcon$newPassLabel ($confirmLabel)</span>" .
"<span class='confirm-yes'>$goodIcon" . $this->_('Matches') . "</span>" .