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

222
Views
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 answers
Answer question

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 Report
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!