Lesson 12. Get interactive with Forms.

Put a form on your page.

This lesson is designed to show customers of our User Homepage Service how to let visitors to their page send them information (to their mail address) in the form of an e-mail. Previously, in lesson 5, I showed you the "mailto:" command. A form does exactly the same thing, except it looks a whole lot more professional. Non-customers of our User Homepage Service don't worry! You can still make a form and put it on your page. Read on!


letter box What are Forms?

Forms are simply the computer equivalent of the paper forms and questionaires we fill out every day. In just about every Web site you will find feedback forms, or any number of surverys or online order forms.

Computer forms get posted right away, while in the real world we tend to procrastinate and put off going to the post office. (At least I do anyway!) All computer forms have a 'SEND' or 'SUBMIT' button to click on which sends the information the user has given directly to the server


letter box Simple Form Example.

My wonderful form.

Your name
Your e-mail

Kind/unkind comments for Kimberly's html lessons.


letter box A) Copy the code.

To put the above dazzling example of a form on your homepage, copy and paste the following code and add it to your own page's code. Of course, you will not want it exactly the same, so click on the colored, italicised text in the code below to understand more and to be able to customize the form to suit your needs.


<!-- -----start of form's code----- -->

<form action="/cgi-bin/form/getmail.pl" method="post">
<input type="hidden" name="reply" value="/reply.html" >
<input type="hidden" name="subject" value="My Homepage">
My wonderful form.
<p>
<table>
<tr>
<td>Your name:</td>
<td><input type="text" name="name" size="30" > </td>
</tr>
<tr>
<td>Your e-mail </td>
<td><input type="text" name="e-mail" size="30"></td>
</tr>
</table>
<p>
Kind/unkind comments for Kimberly's html lessons.
<br> <TEXTAREA cols=45 rows=6 name=feedback></TEXTAREA>
<p>
<input type=submit value=" Send your thoughts">
<input type=reset value=" Clear your thoughts.">
</form>

<!-- -----end of form's code----- -->



picture of a red cross Don't want the form to go on a page in our User Homepage Service?

If you are'nt a customer of our User Homepage Service, you can still copy the above code and put it on your homepage. Just make one small change to the first line of the form's code. <form action="/cgi-bin/form/getmail.pl" method="post">
(/cgi-bin/form/getmail.pl is our User Homepage Service form cgi location.)

Change action="/cgi-bin/form/getmail.pl"
to action ="mailto:your e-mail address"

i.e. <form action="mailto:your e-mail address" method="post">

*Your e-mail address goes straight after the "mailto:" command without a space.
*The e-mail address that you put here is where the answers to your form will be sent.


letter box B) Now, add a "thank you" page.

Only for people who used <form action="/cgi-bin/form/getmail.pl" method="post">
Not for people who used :
<form action="mailto:your e-mail address" method="post" enctype="text/plain">

Once people have finished filling in your form and have 'clicked' the send/transmit button, a screen needs to come up on the computer which confirms that their message has been sent to you successfully. You know something like, "Your message has gone where it has to go. Thanks for your time and all that." Or something equally as reverent and polite.

  1. First, copy the code below and put it between the 2 BODY TAGS in a new html document.
  2. Treat this new document as a normal page and design it however you wish.
  3. Next, save this new document as "reply.html" in the same folder as the Web page you saved your form in.

Copy the code!

<!-- --------thank you page start-------- -->
<meta http-equiv="refresh" content="5 ; url=next URL" >
<title>Thank You.</title>
<p>
<h3>
Thank you!<br>
</h3>
<!-- --------thank you page end------- -->

content="5
The thank you screen will be displayed for 5 seconds before changing to the next page (specified by you in next URL) You can change the amount of seconds the screen is displayed. I put 5 seconds because any longer for me and I start climbing walls.

url=next URL"
Type in the URL of the page that you would like the screen to be changed to after the form's thank you message has been displayed. (This page has to be in your Web folder / home directory.) It should look something like these ;

url=http://given server name/given path/user name/?.html

OR

url=http://given server name/given path/user name/sub folder name in which ?.html is saved/?.html

To the top
Go back to lesson 11. hand pointing left hand pointing up hand pointing right Go to the next lesson.


Read Kimberly's diary entry for this lesson.

jumping kangaroo Back to index page.


picture of heart Thank you for visiting this page
Click to peruse our SpinNet Homepage.
COPYRIGHT
Page created by Kimberly Rigby. / For any comments or questions, click here!