diff options
| author | spiderr <spiderr@bitweaver.org> | 2025-06-07 11:31:44 -0400 |
|---|---|---|
| committer | spiderr <spiderr@bitweaver.org> | 2025-06-07 11:31:44 -0400 |
| commit | b359ab29889c7092adeaccf7b492c60a6ba352f7 (patch) | |
| tree | 4eefdf78ce2632ac09e5f7ea12a78c5814ace2e0 /templates | |
| parent | 1f1f5433d8ebe1f1450ddd895c726e7d3870d659 (diff) | |
| download | users-b359ab29889c7092adeaccf7b492c60a6ba352f7.tar.gz users-b359ab29889c7092adeaccf7b492c60a6ba352f7.tar.bz2 users-b359ab29889c7092adeaccf7b492c60a6ba352f7.zip | |
add show password to login form
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/login_inc.tpl | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/templates/login_inc.tpl b/templates/login_inc.tpl index 32016b2..cbfdf71 100644 --- a/templates/login_inc.tpl +++ b/templates/login_inc.tpl @@ -28,7 +28,14 @@ <div class="form-group"> {formlabel label="Password" for="pass"} {forminput} - <input class="form-control" type="password" name="pass" id="pass" /> + <div class="input-group"> + <input class="form-control" type="password" name="pass" id="password" /> + <span class="input-group-btn"> + <button class="btn btn-default" type="button" id="bw-toggle-password"> + <span class="glyphicon glyphicon-eye-open"></span> + </button> + </span> + </div> {if $gBitSystem->isFeatureActive('users_forgot_pass')} {formhelp note="<a href='`$smarty.const.USERS_PKG_URL`remind_password.php'>Forgot your password?</a> or <a href='`$smarty.const.USERS_PKG_URL`register.php'>Need to register?</a>"} {/if} @@ -56,6 +63,20 @@ {/form} <script> - document.getElementById("user").focus(); + document.getElementById("user").focus(); + $(document).ready(function() { + $('#bw-toggle-password').click(function() { + var passwordField = $('#password'); + var passwordFieldType = passwordField.attr('type'); + if (passwordFieldType === 'password') { + passwordField.attr('type', 'text'); + $(this).find('span').removeClass('glyphicon-eye-open').addClass('glyphicon-eye-close'); + } else { + passwordField.attr('type', 'password'); + $(this).find('span').removeClass('glyphicon-eye-close').addClass('glyphicon-eye-open'); + } + }); + }); + </script> {/strip} |
