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

118
Vistas
How to make a confirmation page in Javascript with a user's inputs from HTML

I'm attempting to make an HTML page with a script that will store the user's input in a query string, then display it back to the user with the appropriate labels/descriptions in a confirmation page. This is what I have so far, I'm very new to Javascript but have some experience with HTML.

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
  <title>Bob's Pet Store</title>
  <script src="petshop.js"></script>
</head>

<body>
  <form id="myForm">
    <h1>Place your customer information below!</h1>
    <h2>Customer Information:</h2>
    <h3>Please enter the neccessary information.</h3>
    <p>First Name: <input type="text" id="fname" /></p>
    <p>Last Name: <input type="text" id="lname" /></p>
    <p>Email Address: <input type="text" id="address" /></p>
    <p>State: <input type="text" id="state" /></p>
    <p>Phone Number: <input type="text" id="number" /></p>
    <br></br>
    <br><input type="submit" id="submit" value="Submit Information"></form>
  </br>
</body>

</html>

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

for this you could use confirm() and .value of the ID to get the job done like so:

JAVASCRIPT:

    function buttonFunction() {

var confirmationFNAME = document.getElementById("fname").value
confirm("Is, " + confirmationFNAME + " the right information?")

var confirmationLNAME = document.getElementById("lname").value
confirm("Is, " + confirmationLNAME + " the right information?")

var confirmationADDRESS = document.getElementById("address").value
confirm("Is, " + confirmationADDRESS + " the right information?")

var confirmationSTATE = document.getElementById("state").value
confirm("Is, " + confirmationSTATE + " the right information?")

var confirmationNUMBER = document.getElementById("number").value
confirm("Is, " + confirmationNUMBER + " the right information?")

}

HTML (added onclick to button):

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
  <title>Bob's Pet Store</title>
  <script src="petshop.js"></script>
</head>

<body>
  <form id="myForm">
    <h1>Place your customer information below!</h1>
    <h2>Customer Information:</h2>
    <h3>Please enter the neccessary information.</h3>
    <p>First Name: <input type="text" id="fname" /></p>
    <p>Last Name: <input type="text" id="lname" /></p>
    <p>Email Address: <input type="text" id="address" /></p>
    <p>State: <input type="text" id="state" /></p>
    <p>Phone Number: <input type="text" id="number" /></p>
    <br></br>
    <br><input onclick = "buttonFunction()" type="submit" id="submit" value="Submit Information"></form>
  </br>
</body>

</html>

Hope this helped, if you got any bugs or problems feel free to reach out or comment.

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