Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

100
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!