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

114
Views
Cómo hacer una página de confirmación en Javascript con las entradas de un usuario desde HTML

Estoy intentando crear una página HTML con un script que almacenará la entrada del usuario en una cadena de consulta y luego se la mostrará al usuario con las etiquetas/descripciones adecuadas en una página de confirmación. Esto es lo que tengo hasta ahora, soy muy nuevo en Javascript pero tengo algo de experiencia con 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 answers
Answer question

0

para esto, podría usar confirm() y .value de la ID para hacer el trabajo así:

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 (agregado al hacer clic en el botón):

 <!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>

Espero que esto haya ayudado, si tiene algún error o problema, no dude en comunicarse o comentar.

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!