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

281
Views
Intentando mostrar los valores de entrada de un formulario en la tabla, pero me da el error 405

Estoy tratando de mostrar los valores de un formulario en una tabla, pero recibo errores 405. Anteriormente estaba usando CSS para diseñar, pero los eliminé, pero aún así, el código no funciona. También lo he buscado en Internet, pero aún así, no puedo encontrar la solución.

¡Soy un principiante, así que cualquier ayuda sería apreciada!

Aquí está mi archivo HTML

 <html> <head> </head> <body> <h1 id="headline"> Welcome to Bread & Butter Co.</h1> <form action="#" method="post" name="form_name" id="form_id" class="form_class"> <label> First Name </label> <input type="text" title="Name" id="fname" placeholder="Enter your First name"> <br> <label> Last Name </label> <input type="text" title="Name" id="lname" placeholder="Enter your last name"> <br> <Label>Phone/Mobile Number</Label> <input type="number" title="Phone Number" id="phone" placeholder="Enter your phone number"> <br> <input type="reset" value="Reset"> <input type"button" class="button" type="submit" onclick="Display()"> </form> </body> <script src="main.js"></script> </html> <div id="table" style="display:none;" class="answer_list" > <table id="myTable"> </table></div>

Aquí está mi archivo Javascript

 function Display() { document.getElementById('table').style.display = "block"; var table = document.getElementById("myTable"); var row = table.insertRow(0); var cell1 = row.insertCell(0); var cell2 = row.insertCell(1); var cell3 = row.insertCell(2); cell1.innerHTML = document.getElementById("fname").value; cell2.innerHTML = document.getElementById("lname").value; cell3.innerHTML = document.getElementById("phone").value; }
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Hay un par de cosas que puedes hacer.

1- Puede eliminar type="submit" de su botón.

2- O puede enviar un evento a su función como onclick="Display(event)" y luego puede usar preventDefault() como:

 function Display(e){ e.preventDefault(); ...
about 4 years ago · Santiago Trujillo 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!