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

260
Views
Cómo validar un cuadro de texto HTML al enviarlo usando JavaScript (solo caracteres alfa, más de 2 caracteres) parece que no funciona la validación
<!DOCTYPE html> <html> <head> <title>Form</title> <link rel="stylesheet" href="styles.css"> <script>

//No estoy seguro de la sintaxis correcta para la validación del cuadro de texto, tratando de permitir solo caracteres alfabéticos. Si no se ingresan caracteres alfabéticos, debería aparecer un mensaje. Al hacer clic en el botón Enviar, al usuario se le debe presentar un mensaje según el resultado.

 funtion validate() { var Frmforename = document.getElementbyName("Frmforename")[0].value; var re = (/^[A-Za-z]+$/); if (re.test(Frmforename)) { alert("Correct."); } } else (re.test(Frmforename)) { alert("Incorrect."); </script> </head> <body> <div> <form> <form action = "donothing.html" method = "Post" name = "FrmRegister" class ="FrmForm" id = "FrmForm" onsubmit="validate()">

// Al hacer clic en el botón Enviar, debería aparecer un mensaje.

 Forename: <input type = "text" name = "Frmforename" id = "Frmforename" placeholder = "Please enter your forename" > <br><br> Surname: <input type = "text" name = "FrmSurname" placeholder = "Please enter your surname" > <br><br> Gender: Male<input type = "radio" name = "FrmGender" value = "Male"> Female<input type = "radio" name = "FrmGender" value = "Female"><br><br> Date Of Birth: <input type = "text" name = "FrmDateOfBirth" placeholder = "Please enter your DOB" > <br><br> Age: <input type = "text" name = "FrmAge" placeholder = "Please enter your Age" > <br><br> Course: <select name="FrmCourse" id="Course"> <option value="Database">Database</option> <option value="Networks">Networks</option> <option value="Web Development">Web Development</option> </select> <br><br> Date: <input type = "text" name = "Date" placeholder = "Please enter the date" > <br><br> <input type ="Submit" name ="Submit" value ="Submit"> </div> </form> </body> </html>
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!