Tip on how to show password

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
User avatar
Chico Gois
Translator
Posts: 99
Joined: Tue Mar 28, 2006 4:42 am
Location: São Paulo - Brasil

Tip on how to show password

Post by Chico Gois »

Open: language/common.php

ADD:

Code: Select all

'SHOW_PASSWORD'=> 'Show password',
Open: template/overall_header.html

Search:

Code: Select all

<link href="{T_FONT_AWESOME_LINK}" rel="stylesheet">
Before ADD:

Code: Select all

<script>
function togglePassword() {
  var passwordInput = document.getElementById("password");
  if (passwordInput.type === "password") {
    passwordInput.type = "text";
  } else {
    passwordInput.type = "password";
  }
}
</script>
Open: template/viewforum_body.html
Search:

Code: Select all

<input type="password" tabindex="2" id="password" name="password" size="25" class="inputbox autowidth" autocomplete="current-password" />
In-Line ADD:

Code: Select all

<input type="checkbox" id="password" onclick="togglePassword()"><label for="showPassword">{L_SHOW_PASSWORD}</label>
Open: template/index_body.html
Search:

Code: Select all

<label for="password"><span>{L_PASSWORD}{L_COLON}</span> <input type="password" tabindex="2" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" autocomplete="current-password" />
In-Line ADD:

Code: Select all

<input type="checkbox" id="password" onclick="togglePassword()"><label for="showPassword">{L_SHOW_PASSWORD}</label>
Open: template/ucp_register.html
Search:

Code: Select all

<!-- INCLUDE overall_header.html -->
After ADD:

Code: Select all

<script>
function togglePassword1() {
  var passwordInput = document.getElementById("new_password");
  if (passwordInput.type === "password") {
    passwordInput.type = "text";
  } else {
    passwordInput.type = "password";
  }
}
</script>

<script>
function togglePassword() {
  var passwordInput = document.getElementById("password_confirm");
  if (passwordInput.type === "password") {
    passwordInput.type = "text";
  } else {
    passwordInput.type = "password";
  }
}
</script>
Find:

Code: Select all

<input type="password" tabindex="2" name="new_password" id="new_password" size="25" value="{PASSWORD}" class="inputbox autowidth" title="{L_NEW_PASSWORD}" autocomplete="off" />
In-Line ADD:

Code: Select all

<input type="checkbox" id="new_password" onclick="togglePassword1()">
<label for="showPassword">{L_SHOW_PASSWORD}</label>
Find:

Code: Select all

<input type="password"  tabindex="3" name="password_confirm" id="password_confirm" size="25" value="{PASSWORD_CONFIRM}" class="inputbox autowidth" title="{L_CONFIRM_PASSWORD}" autocomplete="off" />
In-Line ADD:

Code: Select all

<input type="checkbox" id="password_confirm" onclick="togglePassword()">
<label for="showPassword">{L_SHOW_PASSWORD}</label>
Open: template/login_body.html
Search:

Code: Select all

<input type="password" tabindex="2" id="{PASSWORD_CREDENTIAL}" name="{PASSWORD_CREDENTIAL}" size="25" class="inputbox autowidth" autocomplete="current-password" />
In-Line ADD:

Code: Select all

<input type="checkbox" id="password" onclick="togglePassword()"><label for="showPassword">{L_SHOW_PASSWORD}</label>

Don't forget to clear the cache
Last edited by P_I on Wed Oct 16, 2024 10:26 pm, edited 1 time in total.
Reason: Moved to phpBB Custom Coding
User avatar
nou nou
Registered User
Posts: 702
Joined: Sat Oct 29, 2016 8:08 pm

Re: Tip on how to show password

Post by nou nou »

Oooh nice!

Can this be made into an extension?
User avatar
Chico Gois
Translator
Posts: 99
Joined: Tue Mar 28, 2006 4:42 am
Location: São Paulo - Brasil

Re: Tip on how to show password

Post by Chico Gois »

There is an extension for this, it is up to you.

https://www.phpbb.com/customise/db/exte ... enpassword

Return to “phpBB Custom Coding”