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

184
Views
no se puede deshabilitar la actualización automática de la página

tengo un formulario donde el usuario debe hacer nuevas entradas

ahora el usuario puede hacer una nueva entrada PERO solo una vez


índice.html

 <form id="MyForm"> <input type="text" class="Line" id="Line0"> </form>

índice.js

 MyForm.addEventListener('submit', { handleEvent(event) {//make new line event.preventDefault(); let myForm = document.getElementById("MyForm"); myForm.insertAdjacentHTML("beforeend", "<input type='text' class='Line'id='line1'>") } })

Yo he tratado :

 function new_line(index, event) { //change all indexes before this object let FormArray = Array.from(MyForm) MyForm.insertAdjacentHTML("beforeend", "<input type='text' class='Line' id='Line" + FormArray.length + " onsubmit='return new_line(" + FormArray.length + ")'>") event.preventDefault(); }

y

 function new_line(index) { //change all indexes before this object let FormArray = Array.from(MyForm) MyForm.insertAdjacentHTML("beforeend", "<input type='text' class='Line' id='Line" + FormArray.length + " onsubmit='return new_line(" + FormArray.length + ")'>") return false; }

pero ambas funciones actualizan la página antes de que entienda si funcionan o no

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!