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

193
Views
¿Por qué no puedo ver los resultados del formulario en html?

Soy un principiante en html y estaba tratando de aprender cómo funcionan los formularios en html, pero como se muestra en el siguiente código, no pude obtener los resultados del formulario después de hacer clic en el botón Enviar. ¿Puede decirme por qué no funciona y cómo solucionarlo?

índice.html

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>html/css</title> </head> <body> <form action="result.html" method="get"> <label for="N">Name:</label> <input type="text" id="N" name="Name" required> <br> <label for="P">Phone number:</label> <input type="number" id="P" name="phone_nos" required> <br> <button>submit</button> <br> </form> </body> </html>

resultado.html

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div id="results"></div> <a href="/">Go Back</a> <script> const resultsList = document.getElementById('results') new URLSearchParams(window.location.search).forEach( (value,name)=>{ resultsList.append('${name} : ${value}') resultsList.append(document.createElement('br')) }) </script> </body> </html>

Esto es lo que se muestra en la pantalla después de hacer clic en el botón Enviar

${nombre} : ${valor} ${nombre} : ${valor}

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Intente cambiar el método de formulario a POST en lugar de obtener

--> <form action="result.html" method="post">

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!