Forms, like the one you'll see on my Q & A Page, are extremely simple to create--but getting them to actually do
something useful is another story altogether. Fact is, there really isn't
much you can do with a form using straight HTML.
You can create the elements (text boxes, radio buttons,
etc.), but you can't really get them to do much without using CGI, a
database, or some nifty JavaScript. If you want to learn about the
JavaScript option, I'll have a tutorial up on that sometime in the
(hopefully) near future.
If you don't want to go through that hassle, my suggestion
is this: find a site that will do all of the work for you.
Bravenet is a good choice
(I've used them a lot, and they've proven to be fairly reliable.), but there
are others. Usually, you can use a site like this to create a form, and have
it send you an e-mail whenever someone fills it out.
Now, if you've already gotten a form from
Bravenet or someplace like
it, and you just want to customize it... well, that I can help you with.
If you want a spot on your form for your
visitors to enter text, you have a couple of options. If you just want them
to put in their name, or the subject of their message, the better choice is
the text box:
Go ahead, enter some text. This is how I did
it:
<INPUT TYPE="text"
NAME="textbox" SIZE="30">
It's fairly simple. The
INPUT TYPE just tells the browser you want a text box. The
NAME is the name of that text box--if you have
more than one text box on a page, it's a good idea to name them separate
things. SIZE... well, I think you can figure
that one out yourself.
If, on the other hand, you want your visitor
to be able to enter text of a paragraph or more, a text area is far
better:
Notice you have to close this tag with
</TEXTAREA>, whereas the text box didn't
require a closing tag. ROWS and
COLS simply denote the size of the text
area--play around with it until it's the size you want.
Don't ask me why they're called "radio
buttons", they just are. The input type, obviously, tells the browser that
this is a radio button, not a text box. NAME is
the category for the buttons, all the radio buttons dealing with one subject
should have the same name. For instance, if I wanted two sets of radio
buttons on my page, one for voting about the coolness-level of my site, and
another for voting about whether it was pure genius or super-genius, the
first group's name might be "cool" and the second group's name might be "genius_level".
The VALUE denotes the different options on the
poll, in the example I showed above, one for "coolest ever" and one for
"cooler than all others".
But WAIT! What if you think my site is the
coolest ever AND cooler than all others?! You can only choose one of the two
using radio buttons... looks like this is a job for checkboxes!
Is my site the coolest ever?
Is my site cooler than all others?
SELECT just
says that this is a select (drop-down) box, and SIZE
just tells it what size the box should be. OPTION
SELECTED is the option that is first visible, and the others are,
quite obviously, other options. Don't forget to finish it off with the
</SELECT> tag!
Ok, these are pretty necessary for any form.
If you're using Bravenet or any other service, they should already be part
of the form, but in case you should need them for some reason, the code is:
<INPUT TYPE="submit">
For "Submit" or "Send" and
<INPUT TYPE="reset">
For "Reset" or "Clear".
See? You can make them say whatever you want by adding
"VALUE", like so:
<INPUT TYPE="submit" VALUE="Don't you
dare click me!">
If you want the buttons to be colorful, you can use the
STYLE property:
<INPUT TYPE="submit" VALUE="Don't you dare
click me!" STYLE="background-color:#cc99cc">
And you can even make them look flat, rather than 3D, by
changing the border: