Simple example program of validating form using onblur function


For this tutorial I’m just going to include all of the HTML and Javascript in one file to keep things simple.

So to start off, create yourself a little HTML file, like this.

If the input matches the pattern it will return true, but if it does not, it will return false.

Here is a tutorial for building your own Javascript validation that you can use on any input on your website or web application.

I’ve intentionally kept it as easy, simple and lightweight as possible.