Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

Pre-Fill Forms From Last Use

By Will Bontrager
2005-04-18


Pre-Fill Forms From Last Use

When your visitor fills out any form on your web site, all the other forms on your web site can be pre-filled in with the information s/he provided.

If the visitor provided a name and email address, for example, that name and email address can be pre-filled in all of your other forms. The pre-fill can be during the current site visit and for site visits as long as ten years in the future.

It's done with a cookie.

See http://willmaster.com/ for an example of how it works.

Use any subscription, recommend, or contact form on the willmaster.com domain -- the home page, in the WillMaster Possibilities section, or in the Master Series CGI section. After that, all subscription, recommend, and contact forms on the willmaster.com site will have the name and email fields pre-filled for you.

Your browser must, of course, accept cookies. If not, or if your preferences are set to accept only session cookies (willmaster.com cookies are set for 365 days), then the forms won't be pre-filled in for you.

JavaScript is used to set and retrieve the cookie.

Tutorial Pages:
» Pre-Fill Forms From Last Use
» Why?
» The Source Code
» The JavaScript code of the HEAD Area
» The Form's ACTION Tag
» The JavaScript Below the Form
» A Limitation
» Conclusion


Copyright 2004 Bontrager Connection, LLC


 | Bookmark
Related Tutorials:
» JavaScript Debugging Techniques with Firebug
» Striped Tables Using JavaScript
» Opening PDFs in a New Window with JavaScript
» Essential Javascript -- A Javascript Tutorial
» Submit Forms Conditionally using JavaScript
» How to Setup a Randomising Function

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources