Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

218
Vistas
How to ONLY do the browser-default form validation upon submit?

I have a web form that extensively uses the HTML5 type attributes. I have to submit it in JSON, so I need to prevent the actual submitting, convert FormData to JSON, and POST it using AJAX.

The thing is, I don't feel like writing the data validation myself, and I don't think I wanna add more library for the validation either. They're nothing too advanced, just required attributes, phone number, e-mail, numbers with certain increments, etc. I'd rather let the browser validate using its own mechanisms, then when the time comes to submit my script takes over.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

its quite simple actually. Depending on the type of input, each can be passed props to check like to making every field required, you just pass required to every input. min, max for numbers, type="email" to check emails, maxLength, minLength for string length checking etc. Make sure to pass the proper type too for each field. For more data, visit Inputs explaination at W3Schools. Though, all the checks should be re-done in the backend for security purposes.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda