JavaScript Zone

Script Tutorials

Introduction
Pre-requisites
Installation
Notes

Feedback Form

Introduction
Related Links


This Javascript demonstrates how to create a form to be filled in by the online user, and on completion the form is e-mailed to the creator of the form, for example, to give feedback.

This is based on the Javascript Source's original Suggestions tutorial, but some improvements have been made. Browser details have been removed, and e-mail and subject lines have been added. The e-mail address is checked for proper formatting, and the user name and e-mail address can be saved for future retrieval.

Click on the link below for a demonstration of this script.

Feedback Form Demo

Pre-requisites

  • none, but this script can work in conjunction with the visitor registration script
Installation

  1. Cut and paste the following code to your html page as indicated:

Notes

  • this tutorial demonstrates:
    • how to use cookies
    • how to write a form
    • how to e-mail the contents of a form
  • the code for maintaining cookies is taken from the original date last visited / number of visits javascript from the JavaScript Source - thanks
  • if you use this script, amend the variable names' prefix from pt_ to something meaningful to your site
  • if you add extra fields to the form, you must update the indices of any fields references within the script in the section.


Page last updated 8th August 2001