Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

225
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda