The default behavior of a submit button obvious – clicking it submits the contents of a form to the server. This seems quite straightforward. So, what could possibly go wrong? Well, what if the user double clicks on the submit button rather than clicking it just the once? The contents of the form will be submitted twice. If there is no response to indicate the form was submitted, some users will click again and the form will get submitted again.
AJAX is one of the most interesting web development paradigms emerged a few years back(around 2005). Since the term was first coined,( here ) AJAX has become commonplace in almost all web applications. Overtime, Ajax got many manifestations and applications. Some of the interesting Ajax based implementations include ‘infinite’ scrolling, live validations of usernames, ‘auto-suggest’ boxes and so on. Ever since Ajax was introduced long back, the technology has evolved beyond its earlier definition.
Sometimes, you may feel frustrated when you look at the form submissions that you get from a web form and find out that the respondents did not fill in some crucial details. This calls for some details on the form to become mandatory to fill in. for example, a form that is used to subscribe visitors to regular newsletters via email will be of no use if the user does not enter their email address.
When you handle events for a particular element, it is often required to make a change only within children of the element. Here is how to do it. Suppose this is the HTML code <h2>Select the services you want:</h2> <ul id='services'> <li><img src='tick.gif'>Build a Website</li> <li><img src='tick.gif'>Page design</li> <li><img src='tick.gif'>Flash banners</li> <li><img src='tick.gif'>SEO</li></ul> </ul> When someone clicks on each of the service, the image is to toggle. Here is the jQuery code to do that