
#99 - Fichiers d'entrée personnalisés
Transformez n'importe quoi en fichier d'entrée !
Ajoutez un bouton "afficher/masquer le mot de passe" à tout formulaire comportant une entrée de mot de passe.
Watch the video for step-by-step implementation instructions
<!-- 💙 MEMBERSCRIPT #45 v0.2 💙 SHOW AND HIDE PASSWORD -->
<script>
document.querySelectorAll("[ms-code-password='transform']").forEach(function(button) {
button.addEventListener("click", transform);
});
var isPassword = true;
function transform() {
var passwordInputs = document.querySelectorAll("[data-ms-member='password'], [data-ms-member=' keywordnew-password'], [data-ms-member='current-password']");
passwordInputs.forEach(function(myInput) {
var inputType = myInput.getAttribute("type");
if (isPassword) {
myInput.setAttribute("type", "text");
} else {
myInput.setAttribute("type", "password");
}
});
isPassword = !isPassword;
}
</script>vraiAdd these data attributes to your HTML elements in Webflow. For example: <div data-attribute="value">
Ajoutez ms-code-password="transform" à votre bouton "show password".
The 1st click will show the password and the 2nd click will hide the password. Which means, you can use Webflow interactions, a checkbox, or Webflow tabs to toggle between show & hide buttons.
More scripts in Custom Fields