ajout mot de passe en clair avec js sur page de connexion
This commit is contained in:
@@ -34,8 +34,13 @@
|
|||||||
<input
|
<input
|
||||||
type="password"
|
type="password"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
|
id="password"
|
||||||
placeholder="••••••••"
|
placeholder="••••••••"
|
||||||
/>
|
/>
|
||||||
|
<label for="showPassword">
|
||||||
|
<input type="checkbox" id="showPassword" />
|
||||||
|
Voir le mot de passe
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="btn btn-primary w-100">Se connecter</button>
|
<button class="btn btn-primary w-100">Se connecter</button>
|
||||||
@@ -46,6 +51,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script src="page_de_connexion.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
35
connexion/page_de_connexion/page_de_connexion.js
Normal file
35
connexion/page_de_connexion/page_de_connexion.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
const password = document.getElementById('password');
|
||||||
|
const confirmPassword = document.getElementById('confirmPassword');
|
||||||
|
const showPasswordCheckbox = document.getElementById('showPassword');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
showPasswordCheckbox.addEventListener('change', function() {
|
||||||
|
if (this.checked) {
|
||||||
|
password.type = 'text';
|
||||||
|
confirmPassword.type = 'text';
|
||||||
|
|
||||||
|
} else {
|
||||||
|
password.type = 'password';
|
||||||
|
confirmPassword.type = 'password';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user