Good idea. It really looks professional when you allow net surfers to fill in information right to your page rather than using a "mailto:" command. And looks are about it. A form does basically what email does - it sends information.
Please be advised that this tutorial will work on Netscape style browsers and MSIE 4.0 browsers only. The form commands will work on Explorer browsers 3.0 and below, but will not act as a guestbook in the same way they will in Netscape and MSIE 4.0. If you use the format below with a lower version of MSIE, you won't get any errors, just a basic email box will pop up. -- Joe
Use these to jump to a particular item - or read it all!
[The First Step][The Text
Box][Text Area Box][The
Radio Button]
[The Check Box][
The Pop-Up Box][Send and Reset
Buttons]
Remember: you will need to put your email address
immediately after the "mailto:" without a space!! This is where
the results of the form will be sent.
That's nice and simple. Now that the computer knows a form has begun, it's looking for any one of a number of form styles to deal with. I will go over five here; TEXT, TEXT AREA, the RADIO BUTTON, the CHECKBOX, and the POP-UP BOX. These are by far the most used on the WWW. Also, I will go over the creation of buttons that send the form to the "mailto:" address or clears the form.
Go ahead. Write something in it. It works. You may have to use your mouse pointer and click on the box to activate it - but it works. If this is your first time making forms, you might think that the box above is a .gif or a .jpeg. Not so. The box is placed on the page through an HTML command, not as an image. The command to place it on the page is this:
<INPUT TYPE="text" NAME="name" SIZE="30">
name=(whatever is written in the box)
That way you know this information was written in the box marked "name". Also - remember you don't have to call the box "name." Call it what ever you want. It will arrive to you with that name. If you're using the box to get the reader's name, call it "name." If you're using the box to get the reader's email address, call it "email." etc etc.
Neat, huh? Again, go ahead and write in it. It'll work. You may have to click on the box to activate it. Here's the command that made it appear:
<TEXTAREA NAME="comment" ROWS=6 COLS=40></TEXTAREA>
Please note that the TEXTAREA requires a </TEXTAREA> command whereas the TEXT BOX command above did not.
- -
Go ahead. Click on them. I know you're dying to. I have three of them there to prove a point. The point is that radio buttons are a one choice deal only. When you use radio buttons, only one can be checked. When another is checked - the first one gives up its selection. Go ahead - try it.
Neat, huh? But why are they called radio buttons?!?! The reason is that they act as the radio buttons used in older car radios. When you pushed one, the dial moved. When you pushed another, the first choice was dropped and the dial moved again. You're probably too young to remember. It was back when AM only was a big selling radio, back before dirt. (Man, I'm old.)
Here's the command to place a radio button on your page.
<INPUT TYPE="radio" NAME="heading of button" VALUE="button name">
You see - the TYPE in the command is "radio." The command is long, but it's not that difficult to understand. Here are its four parts and what they mean:
THUS...when the form arrives to you, the email would read:
"signing_in_from_ home_page"
Pretty darn slick, huh?
- - - -
Go ahead. Click around a bit. You'll note that just one or every one can be chosen. This checkbox is basically a fancy radio button. Here's the command that placed the checkbox on the page:
<INPUT TYPE="checkbox" NAME="Signing_from" VALUE="Joes_page">
Each of the items mean the same as above so there's no need to go over them again. Please note, however, the TYPE is now "checkbox" instead of "radio."
Remember that when the text from a check box arrives at your email box, more than one can show up. With radio buttons, only one item under the NAME heading will arrive. With checkboxes, every item can be checked, thus every item can arrive.
I like radio buttons much more than checkboxes. The reason is that the radio button forces a choice. Checkboxes invite people to just check everything every time. That can waste your time reading through it all. I like to make a one choice deal. It's easier on me and if people want to leave more info, there's always the TEXT AREA box for that purpose.
<SELECT NAME="Favourite_Colour" SIZE="1">
<OPTION SELECTED>Blue
<OPTION>Red
<OPTION>Yellow
<OPTION>Green
<OPTION>Black
<OPTION>Orange
<OPTION>Purple
</SELECT>
Although this looks a little bit more involved - it really isn't. It's the same thing again and again. Here are the parts and what they mean:
This may be the easiest of all the items I've shown on this page.
Here are the buttons:
<INPUT TYPE="submit"><INPUT TYPE="reset">
Easy, huh? Now when you click on the buttons, the form will
enact the ACTION you noted in the original FORM command. Here it
would have been mailed to my email box. (or not in this case)
[The First Step][The Text
Box][Text Area Area Box][The Radio Button]
Send and Reset Buttons
Well, now that the you have placed all the form items you want on
your page, you need a way to have the results sent to your email
box (or where ever you said this would go in the original form
statement).Please do not use the buttons. They are active and will
attempt to work - however I have put in a false email address so
I don't fill my own box with email from this tutorial. You're
just going to get scolded!
And here are the commands to put the buttons on the page:Finally!
Make sure you end your page with this:
</FORM>
That's a beginning on forms, but there is so much more you can do
than what I have here. There are forms you can connect to other CGI's (Common Gateway Interfaces), databases, or other data collection devises. All I wanted to do here was
give you a very basic, very easy form for you to use on your web
pages.
[The
Check Box]
[The Pop-Up Box][Send and
Reset Buttons]