This documentation was adapted from the Web Form with Transform 3.0: the Users' Guide. Transform is ONLY available to Indiana University.
This is a continuation of the Using Transform to Process Web Forms tutorial and covers how to create a web guestbook.
Creating a guestbook will result in three files:
A guestbook form generally does not contain as many fields as other web forms and usually does not require a name or other identifying data from the reader. For ideas on setting up your guestbook form, see the Sample Web Guestbook Form. For a refresher course in creating web forms, see Creating Web Forms.
Remember, these forms tutorials assume you are using the Transform forms utility, and that your web page is on the IUPUI champion.iupui.edu server in your home directory [~networkid] . Therefore, the action statement in your form (after Form method= ) will be:
var mydate=new Date()
if (year < 1000)
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","
document.write(""+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"")
After you have completed and viewed your form file for accuracy and layout,save the file with the name: guestbook_form.html. (The tutorial is using this name; you may name your file anything you like, as long as you remember that both the HTML file and the accompanying Transform template file have the same name.) Place it in your champion www/Forms directory that you created in previously during these tutorials (for a review of setting up your champion account in order to use Transform, see Installing Transform in your Account).
Return to top
For a review of Transform and the basic set-up of Transform template files, please review Using Transform to Process Web Forms. Remember,
As you create the template file, type the information requested exactly as it is shown in the sample below. In the case of italicized text, replace the information requested with your own information. For example type your E-mail address here should be replaced with the E-mail address to which you wish the form responses sent. (Even though you are creating a file that will be displayed on the web, Transform requires the E-mail response section.)
NOTE: You must be careful about the size of the file if you use the sample below. When data responses are appended in the manner described below, Transform must read through the entire file, then re-write it with each submission. If your guestbook grows very large, the response time will decrease dramatically. When you note that the response time has grown unacceptable, you should consider editing the guestbook.html to remove the older entries, placing them in a secondary file if you wish to retain them for reference or to link to them for your readers' benefit.
# begin template
# *email-response* section
To: type your E-mail address here
Subject: Guestbook Entry
# Notice that we are making the comments a required field.
# This will prevent you from receiving blank guestbook entries.
Please sign my guestbook: [req-comments]
# Now let's add a section which describes a successful form submission
# Note the *success-response* section header
# Since this response is being returned to the user's www browser it
# must be a correct HTML document and may contain any valid HTML tags.
<P>Thank you for signing my guestbook!</P>
# This section defines where the guestbook itself resides on
# the web server. The guestbook file must reside in your main www directory
# so that Transform knows to make it a publicly read-able file.
# This path indicates that the guestbook file will be found up one
# directory level from the Forms directory. In other words, your
# www directory.
<P>To read other entries, enter <A HREF="../guestbook.html"><B>guestbook</B> now.</A></P>
# This error trapping section returns a message to the reader who
# attempts to submit a blank guestbook form entry.
<TITLE>Oops. We need more info!</TITLE>
You forgot to enter a comment: [comments]<BR>
<P>Use your browser's back button to return to the form.</P>
# The section appends the guestbook form entries to the guestbook itself.
# The append-before command specifies that data are entered before
# the horizontal rule (used to separate entries).
# This keeps your guestbook entries in reverse chronological order.
# The append-file-name command specifies the name and location of
# the guestbook file.
!append-before = "HR"
!append-file-name= ~type your networkid here/www/guestbook.html <P ALIGN=center><HR></P>
# !DATE captures the current date for your guestbook entry.
<P><B>On [!DATE] this comment was added:</B><BR>
<font color="#663300"> [comments]</font>
# end template file
Return to top
Although Transform will create the guestbook.html file when the first form submission is processed, you may prefer to create the file yourself so that you can affect the appearance of the guestbook. The *append-response* section of the template file controls how individual data entries/submissions will be added to the guestbook.html file. Submitted data will be appended to the file below any content you may have supplied. Our sample guestbook has a green background and a title.
Remember that the guestbook.html file must reside in your main www directory, not the Forms directory.
Do not include any additional closing HTML tags because submitted forms will append BELOW the last item you type in this file, causing the closing HTML tags to be ABOVE the first form data.
Return to top
Return to Using Transform to Process Web Forms