There are several different formats you can use to make a form. Instead
of trying to explain in English how to do it, I thought I might try it
by example, with the code directly below the form, so you can see how it
was done.
There are a couple of things you should know before you get started. One
is that you will not be able to forward your submitters to another page with
the "mailto:you@domain.com". You need to use a cgi script for that. You can
pick up a script that is hosted somewhere else if you cannot upload scripts to
your server. The script I am using here comes from CGI for Me, and you can go
here to find all kinds of fun scripts to use on your web pages:
http://www.cgiforme.com
A form does not "necessarily" have to have a "method" but it must always have
an action. You can only define one action per form, unless of course you find a
cgi script that will allow more.
You must always have one and only one < form > and one < /form > tag per form.
You will use the starting < form > tag to define your method and your action.
A Very Simple Form
Code for the simple form!
<form method="post" enctype="text/plain" action="url of your
cgi script or mailto:you@domain.com">
<input name="Enter Name" Type="Text"
Value="Your name here." size=44>
<input name="Email Address" Type="Text"
Value="Enter your email address here." size=44>
<textarea name="Comments" rows=10 cols=45>
Enter Your Comments Here.
</textarea><br>
<input type="Reset">
<input type="Submit">
</form>
This for will allow visitors to enter their name, email address, and comments,
and submit them to an email address.
Checkbox Type Form
This type of form lets you do kind of a survey. There are many things
to you could get structured input on from this type of form.
Code for the Checkbox Type Form!
<form method="post" action="url of your
cgi script or mailto:you@domain.com">
<input name="Enter Name" Type="text"
Value="Your Name Here" size=44>
<input name="Email Address?" Type="text"
Value="Enter Email Address Here" size=44>
Specify your fruit preferences(check all that apply):
Now for something that is a little more interesting. Suppose you want to use buttons to move a viewer through your pages. But, let's say you want all your viewers to be able to use the buttons, not just your javascript enabled viewers. Here is my solution to that.
By clicking on either one of the buttons above you will be taken to their respective pages. To get back here....just use the back button on your browser.
You can have as many of these "forms" on your page as you want. Below is the code I used to make them. You can use that code and adjust it to fit your needs.
<form method=get action="url of your message board">
<input type="submit" value="Web Publishing Message Board">
</form>
<form method=get action="url of your guestbook">
<input type="submit" value="Sign My Guestbook">
</form>
You would replace the action with the url of where you want the button to take your user, and you would replace the value with the text you want on the button.
Getting tired of people not filling out your forms completely? Well how about making it required that they do so? By doing that, they will not be able to send the form without it being filled in where you need it to be. Check out the form below....the code is below it.
This is a test form for required fields. Go ahead and try and send it without filling out one of the sections. On this form a radio button must be checked, a name must be entered, and an email must be entered before the form will send.
Once you do fill it out properly, the send button will just send you to this page, so you won't get lost. It will also send me an email with the information you provided.
Code for the Required Field Form
<form method=post action="url of your
cgi script or mailto:you@domain.com">
<input type="hidden" name="require:subject" value="Test Form">
Test Button #1
<input type="radio" name="tester" value="Test Button #1">
Test Button #2
<input type="radio" name="tester" value="Test Button #2">
Test Button #3
<input type="radio" name="tester" value="Test Button #3">