Our contact form will also have built-in spam prevention and form validation.
The first thing we need to do when building the contact form is to setup the proper HTML structure with the appropriate Bootstrap classes.
The option of using pure HTML, sometimes with a touch of CSS, to complement Java Script form validation was until recently unthinkable.
Sure there have been all kinds of whacky plug-ins over the years aimed at achieving this, but never a single standard that we could work towards.
Initially, it looks like we’re using quite a bit of code but notice that a lot of it is repetitive. We’ve covered quite a bit of code and it was broken down into several different chunks.
The script has a catalog of almost all the common validation types built-in.
The idea is to create a set of “validation descriptors” associated with each element in a form.
First, download the Java Script form validation script here.