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

201
Views
el formulario no se envía con java script

Quiero enviar un formulario sin actualizar

aquí está el código:

 <form id="rout" > <div class="mb-3"> <label for="exampleInputEmail1" class="form-label">your id</label> <input type="text" class="form-control" onchange="" id="exampleInputEmail1" aria-describedby="emailHelp"> </div> <div class="mb-3"> <label for="exampleInputPassword1" class="form-label">first name</label> <input type="text" class="form-control" id="exampleInputPassword1"> </div> <div class="mb-3"> <label for="exampleInputPassword111" class="form-label">last name </label> <input type="text" class="form-control" id="exampleInputPassword111"> </div> <div class="d-grid gap-2"> <button id="btbtbt" class="btn btn-primary" type="submit" style="text-decoration: none "> submit </button> </div> </form> <script> const myForm = document.getElementById("rout"); myForm.addEventListener("submit", (e)=>{ e.preventDefault(); const req = new XMLHttpRequest(); req.open("post","router.php"); req.onload= function (){ console.log(req.responseText); } req.send(new FormData(myForm)); }); </script>

centrarse en la parte del guión

esto es lo que tengo: ingrese la descripción de la imagen aquí

Sé que este código funciona

Lo probé antes

pero no funciona aquí

¿Cuál podría ser la razón?

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