HTML 5 Form Validation with JavaScript, JQuery and Ajax

HTML Form validation is important part while building a website having form fields.

The input fields need to validated and checked if there are null values.

This post will show you different types of validation possible using Client side browser validation and using JavaScript.

input “required”

The required attribute is a boolean attribute.

When present, it specifies that an input field must be filled out before submitting the form.

When you hit the submit button


For spring MVC it will be like required = “required”

required should primarily be seen as a UI helper only. Data Validation should be done on server side to avoid any breach.

JavaScript Form Validation

When you submit a form on clicking a button with empty field.



JQuery Validation

This slideshow requires JavaScript.

Ajax Validation (Back End Validation)

null value checker
jQuery Ajax
form fields
back end express js router code

This was a vary a basic tutorial on how validation works.

Stay tuned for complex validation in upcoming posts.

Hope it helps!.


2 thoughts on “HTML 5 Form Validation with JavaScript, JQuery and Ajax

  1. This tutorial is really useful. I have used it with form validation in Expressjs middleware . It works well. and I have got the best way from these tutorials. So, Thanks for sharing the knowledge.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s