Wednesday, January 21, 2015

Auto-Filling Forms With jQuery And The Web Storage API


In a project I developed a few years ago there was a search form made of a main field and then many other fields to refine the search. In that project a user typically needed to perform the same search multiple times with just one or two fields changed. Filling the form again and again was a pain so we decided to help the users in quickly achieving their goal.

In this article I’ll show you how to recreate the same improvement using jQuery, jQuery.deserialize, and the Web Storage API.

The Requirements
To improve the form I mentioned in the introduction, we decided to show a list of previously performed searches, up to 20. The searches are stored into the browser using the Web Storage API. If you have a login system in place, you may want to modify the demo so that the searches are stored in a database. In my case this wasn’t an option as there wasn’t a login system.

Read More

No comments:

Post a Comment