File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed
Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 2323 required minlength="3" autofocus />
2424 <?php if (isset ($ _ ['passwordRequired ' ]) && $ _ ['passwordRequired ' ]): ?>
2525 <label for="password" class="infield"><?php p ($ l ->t ('Password ' )); ?> </label>
26- <input type="text " name="password" id="password" class="bbb-input"
26+ <input type="password " name="password" id="password" class="bbb-input"
2727 placeholder="<?php p ($ l ->t ('Password ' )); ?> " value=""
2828 required minlength="8" />
29+ <input type="checkbox" name="password-visibility-toggle" id="password-visibility" class="checkbox" value=""/>
30+ <label for="password-visibility"><?php p ($ l ->t ('Show Password ' )); ?> </label>
2931 <button class="primary"><?php p ($ l ->t ('Join ' )); ?>
3032 <div class="submit-icon icon-confirm-white"></div></button>
3133 <?php else : ?>
Original file line number Diff line number Diff line change 1- import './join.scss' ;
1+ import './join.scss' ;
2+
3+
4+ $ ( ( ) => {
5+ $ < HTMLInputElement > ( '#password-visibility' ) . on ( 'change' , function ( ev ) {
6+ ev . preventDefault ( ) ;
7+
8+ console . log ( `checkbox ${ ev . target . name } changed to ${ ev . target . checked } ` ) ;
9+
10+ const passwordField = document . querySelector ( "#password" ) as HTMLInputElement | null ;
11+
12+ if ( passwordField != null ) {
13+ if ( passwordField . type === "password" ) {
14+ passwordField . type = "text" ;
15+ } else {
16+ passwordField . type = "password" ;
17+ }
18+ }
19+ } ) ;
20+ } ) ;
You can’t perform that action at this time.
0 commit comments