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

165
Views
Entrada de usuario de validación usando javascript

Soy novato en php, html y javascript. Mi objetivo es verificar y validar la entrada del usuario. Mi código funciona solo para un campo de entrada que no está en bucle. En un momento, quiero verificar varios campos de entrada del bucle, la respuesta del código es "* Inserción incorrecta: indefinido, posición: nula".

Serias tan amable de decirme que estoy haciendo mal?

bloque de javascript

 function ValidationSubmit() { var DatabaseIndex = document.getElementById("3").getAttribute("name"); var CheckInt = document.getElementById("3"); var CheckIntVal = CheckInt.value; const a=-10; if( a < 0 ) { document.getElementById('demo').innerHTML = "* Wrong insert : " + CheckIntVal + ", position: " + DatabaseIndex ; return false; } else { return true; }

bloque php para llamar a la función de validación ValidationSubmit()

 echo '<form method="POST" target="_top" action="SaveForm.php?UID='.$UID.'" onsubmit="return ValidationSubmit()">';

bloque php para la entrada del usuario

 $j = 0; while($j<=10) { $ID = strval($j); echo "<td><input type='text' id='$ID' name='$ID' value='$value[$j]' ></td>"; $j++; }
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!