News & Blog

jQuery Reset Form

How To Reset a Form Using jQuery

February 20th, 2013 - Posted by Steve Marks to Javascript / jQuery, Web Development.
I explain through code samples how to correctly empty a form and reset it back to it's original values using jQuery. This is a particular scenario where the reset is done via an external trigger....

Check if a Form Element Exists Using JavaScript

July 19th, 2012 - Posted by Steve Marks to Javascript / jQuery, Web Development.
In my day-to-day work I get involved with hundreds of forms. Some of these forms are similar, differing only very slightly with the addition of the odd textbox, but all require some sort of validation. Rather than have a separate JavaScript function for each scenario, it’s sometimes ...

Disabling the Submit Button to Prevent Double Form Submission

December 21st, 2010 - Posted by Steve Marks to Javascript / jQuery, Web Development.
Whether it be due to a users lack of tech know-how or a twitch of the finger, a secondary click of a forms ‘Submit’ button could result in the form being submitted twice. Depending on the action of the form this could in turn send two enquiries, create two orders or insert a re...

Reasons Why a HTML Form Might Not Submit

September 23rd, 2010 - Posted by Steve Marks to (X)HTML / CSS, Javascript / jQuery, Web Development.
I’ve had it lots of times throughout my career; you build a form and it will not submit. I know how frustrating this can be so I’m going to outline a few reasons why this might be below: 1. Check your HTML Structure In order for a standard HTML form to submit successfully it re...