Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

122
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda