Article | Date posted : 2 February, 2014 | Updated on : 8 March, 2014

jQuery checking for empty form fields

Sponsored Links

In every html form you want to prevent your visitors from continuing to the next stage if certain fields have not been filled in. The smartest way is to let jQuery handle this so that you do not need to refresh the page. Simply do it all on the fly.

The easiest way to check for empty fields is to measure the length of the entry, when we measure the length of the entry we can also check for a minimum length such as 3 characters.

Explaining how to check for empty form fields

Lets assume that we have an input field named firstname

In the jQuery file we will write the following script which will detect if the visitor has entered any details


Sponsored Links


Leave a Reply

Your email address will not be published. Required fields are marked *

Follow me on Google+

Google Shopping Data Feed Generator

Sponsored Links

Hire Me