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

124
Views
Why won't my form inputs push into the array?

All my variables are rightly placed, however, the code still doesn't run. So no matter how I tinkered with the code, the data in the form doesn't register the information. Can someone tell me what exactly is the error in this code?

<div class="regi-04">
            <label for="phone"></label>
            <div>
                <input id="phone" name="form05" type="email" autocomplete="off" placeholder="Enter Your Phone">
            </div><br>
        </div>
<div class="submit">
        <button class="button02" onclick=" regisUser(); "> 
        Proceed With Registration </button></div> 
<script>
var registers = [
{name1: "user", username: "user345" , email: "abc123@gmail.com", phone: "09999" , country: "Germany", password: "password123"}
];
  
function regisUser() {
      
  var nam = document.getElementById("name").value;
  var user = document.getElementById("username").value;
  var mail = document.getElementById("email").value;
  var pho = document.getElementById("phone").value;
  var kuni = document.getElementById("country").value;
  var pass = document.getElementById("password").value
      
registers.push({name1:nam, username:user, email:mail, phone:pho, country:kuni, password:pass})
alert(registers.length)
  } </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

function Validate is not defined, run the snippet here or in the browser dev tools console.

var registers = [
{name1: "user", username: "user345" , email: "abc123@gmail.com", phone: "09999" , country: "Germany", password: "password123"}
];
  
function regisUser() {
      
  var nam = document.getElementById("name").value;
  var user = document.getElementById("username").value;
  var mail = document.getElementById("email").value;
  var pho = document.getElementById("phone").value;
  var kuni = document.getElementById("country").value;
  var pass = document.getElementById("password").value
      
registers.push({name1:nam, username:user, email:mail, phone:pho, country:kuni, password:pass})
alert(registers.length)
  } 
<div class="submit">
        <button class="button02" onclick="validate(); regisUser(); checkNum();"> 
        Proceed With Registration </button></div> 

about 4 years ago · Juan Pablo Isaza Report
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!