HOW TO MAKE A FORM

[Before you go through this help page, I suggest you open a notepad or something and minimize it, then as you go you can copy and paste the codes.] So many people have wanted forms on their sites but they don't know how; so I created this help page. So, off you go!

First things first, you need to start a form; use this code:

<FORM METHOD=POST ACTION="mailto:your@email.com" NAME=form_name>
FORM starts the form. METHOD says it is post, this means it will be sent through e-mail. ACTION is the e-mail address, though if you just put your e-mail address here it will be in funny code when you receive it. Two ways I know to prevent that: If you are in Geocities, use this code: ACTION="/cgi-bin/homestead/mail.pl?membername" using this it will be sent to your e-mail that Geocities has, just don't forget to put your member name in! If somewhere else hosts your page see if they have a service like this. The other thing to do is to go somewhere that gives this service, for instance, if you join Bravenet , you have use of their e-mail service as well as search engines, message boards, polls, and lots more. There are several places that do this. Finally, NAME=FORMNAME is not essential, you can name the form if you want. Please note: you do not have to use capitals in the code.

Now, to create the form. Lets start with something simple:


How I did this: <INPUT TYPE=text SIZE=30 NAME="example box" MAXLENGTH=30 VALUE="Hello!">

INPUT tells that it is some kind of input. TYPE says what type of input, this time it's a text box, so it's TEXT. SIZE means how many charachters long you want the box, I like 30. NAME is what the box is called, this is what it will say when you receive it via e-mail. Example of received e-mail:
(name)John (e-mail)john@johnnyboy.com (URL)http://www.johnnyboyshomepage.com
Now Name, e-mail and URL are all names of the boxes. Another tool you can use is MAXLENGTH=30. Change the 30 to whatever number you want, this just means that you can't type more than thirty charachters. Try typing more than 30 charachters in my box. See? If I put 20, you couldn't do more than twenty. Got it?! Last of all, VALUE="Hello!" is not necessary either, it just means that you can already have some text in there, ie. for a URL box you might want http:// .

Now, unless you have a proper server and you are able to make password protected pages, then you won't need these. But they're fun.


How I did this:
<input type="password" length="30" value="Secret!">
Everything here is the same as plain text boxes.

Now lets try a big box:


How I did this: <textarea name="sample" rows=7 cols=40 value="Hello!"></textarea>
TEXTAREA starts the whole thing off. NAME is the same as in plain text boxes. ROWS is how many rows you want it to be, and COLS is how many columns. In this case it's 7rows and 40cols. VALUE is the same as text boxes. /TEXTAREA ends it all.

Now for something more complicated:

How to do this:

<SELECT NAME="favourite_number" size=1><OPTION SELECTED>1 <OPTION>2 <OPTION>3 <OPTION>4 <OPTION>5 <OPTION>6 <OPTION>7 <OPTION>Other</SELECT>

This is easier than it looks. SELECT starts it of (duh), and NAME is the same as the others. SIZE is, well, I like one, but try other numbers and see for yourself. No, I'll show you: this is size 2:

OPTION SELECTED is the option you'll see. OPTION means all of the others. Don't forget to put it after the > not after =" . /SELECT ends it all.

What about boxes?

How I did this:

<input type="checkbox" name="WHICH ONE?" Value=alright>
This input type is 'checkbox'. Notice you can select more than one? NAME is the same as the others, what it will appear as when you recieve it. VALUE must be the same in every box, for this tells it that they belong to the same group. If you have two questions, the second boxes can have another value, for they are a different group. Now you know checkboxes!

Next, radio boxes:


How I did this:
<input type=radio name="button name" value="button category">

This is very simialar to checkboxes, but notice you can't click more than one. So the input type is RADIO, VALUE is what it will appear on your e-mail, and NAME groups them all together so you can't click more than one in each group. If the name is different in each one you'll be able to select them all. Repeat the code for each box but change the value.

Alright, you know most of it - but whats missing?


<input type=submit value="Send"><input type=reset value="Clear it">

SUBMIT is the sending button. VALUE means you can write whatever you want the button to say, though if you don't write anything here it will just say submit. RESET means that all the stuff in the form will be cleared. VALUE is the same as the submit button. Finally, you're at the end- though there is one very important thing left:

</form> You must end it like that or DISASTER will strike!!! Well, now you can do forms, happy forming!

Home