Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

102
Vistas
name attribute inhibits onclick function

The code below works fine, it changes the type of password to reveal the input as text. The prolem appears when adding a name attribut to "password" in order to retrieve data from $POST in php. I thought there might be a way to get the data on serverside without a "name", but my reasearch showed that without a "name" attribute no data can be retrieved.

Question: How to bring in the name attribute and keep my functionality?

            <div>
                <label for="password">Passwort (8 min. pls. )</label>
                <input type="password" id="password" minlenght="8" required>
            </div>
            <div>
                <label for="anzeigen">Passwort anzeigen</label>
                <input type="checkbox" onclick="anzeigen()" >
            </div>
            <div>
                <input type="submit" id="mitmachen" value="mitmachen">
            </div>
        </form>
        <script>
            function anzeigen() {
                var x = document.getElementById("password");
                if (x.type === "password") {
                    x.type = "text";
                }else {
                    x.type = "password";
                }
            }
        </script>
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda