Clipart, Java Scripts, Backgrounds, Internet Marketing & more Webmaster Resources

Webmaster Resources: Develop, Promote, & Profit!

Clipart, Java Scripts, Backgrounds, Internet Marketing & more Webmaster Resources

Please take our quick poll and help to improve HowAmazing.com!

Domain Names


Forms Tutorials   

Category Feature: WebPageBackGround.com


HowAmazing In-Site Tutorials: Forms  |  Tables  |  Image Maps

forms

Below you will find a step-by-step guide that will walk you through the process of creating contact forms for your Web Site.

Starting Out

The first thing you must tell the browser is that you are starting a form, and what you want done with the form data. The command to alert the computer is:

<FORM METHOD="POST" ACTION="mailto:your email address">

Notice the command did three things:

  1. It told the computer a FORM was starting.
  2. It stated the METHOD of dealing with the form is to POST it.
  3. And the data should be posted to your email address through the "mailto:" ACTION.


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 browser knows a form has begun, it's looking for any one of a number of form styles to deal with. We'll 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, we'll will go over the creation of buttons that send the form to the "mailto:" address or clears the form.


BOXES FOR ENTERING TEXT


The Text Box

This is a basic long box that allows for one line of text. When placed on a page, your reader will be able to write in information such as their name or their email address. Here what a text box looks like:

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">

There are three parts to the command. Here's what they are and what they mean:

  • INPUT TYPE tells the browser that a form item is going to be placed here. Remember above you placed the command to alert the browser that form items will be placed on this page? Well, here's your first form item. This form type is "text".
  • NAME is the name you assign to the box. Remember that this is a form that will be sent to you through the mail. When you receive the mail, it won't be just like the page. Only the text will arrive, so you have to denote what each piece of text will be. When the mail arrives from this text box, it will say:

    name=(whatever was 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.

  • SIZE denotes how many characters long this box will be. Make it 60 or 100 if you'd like. 30 is usually a good size.

2. The Text Area Box

This is a larger box, like the one above, that allows your reader to write something. The difference between the Text Box (above) and the Text Area is that the Text Box only allows for one line. The Text Area, however, is much larger and will allow for as many words as you want.
Here's a Text Area Box:

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.

Just as before...here are its parts and what they mean:

  • TEXTAREA (All one word). This tells the form command above that here will sit another form item. This one will be a text area box.
  • NAME is the same as before. The information the reader puts in this box will arrive in your email box denoted by what ever name you use. In this case, what is written in this box will arrive in your email box with the words, "comment="
  • ROWS tells the computer how many rows of text it will accept and...
  • COLS tells the computer how many characters will be in each row. This text box will accept 6 rows of text each being 40 characters long.

Input Buttons


The Radio Button

This places a selectable circle on the page. That circle is active and a reader can use the mouse to click on it. When the radio button is chosen, it darkens. Here are three radio buttons:

- -

Click on them. There are 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.

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.

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:

  • INPUT This means - "Here's a form item to deal with!"
  • TYPE This tells the browser what type of form item it will be. In this case - it's a radio button.
  • NAME This names the category the button is in on your form page. Let's say you have six different choices under one heading. Like six items you're selling all under the heading, "Content Categories." "Content Categories" would be the category. It's the heading of the group of radio buttons.
  • VALUE is the name assigned to the button. Like in the content example above, you have six buttons each labeled with six different items. Well, you would give one the value of CD-Roms, one DVDs, etc etc.

Remember that this is going to be sent to you through the mail. You will have to be able to read what the person chose. Say you had a e-mail form with a section of radio buttons that ask which area of the site the user is having a problem with. Your "NAME" in the command might be "site_area." Then each of the radio buttons is assigned the "VALUE" of each of your pages. Let's say a person chooses the radio button assigned to your front page. That button's VALUE might be, "front_page."

THUS...when the form arrives to you, the email would read:

"site_area_ front_page"


2. The Checkbox

The checkbox is an exact clone of the radio button except for two distinct features:

  • The item it places on the page is square and it is marked with an "X" when chosen.
  • You can check as many as you'd like.

Here are a few checkboxes:

- - - -

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="site_area" VALUE="front_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 in your e-mail 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. Make a one choice deal. It's easier and if people want to leave more info, there's always the TEXT AREA box for that purpose.


The Pop-Up Box

The Pop-Up box, unless clicked on, only shows one item. But, this is your form and you can do anything you wish. Here's a Pop-Up box. You have to click on it to see all the choices. We'll use a content provider as an example

Here are the commands that placed the Pop-Up box on the page:

<SELECT NAME="content_type" SIZE="1">
<OPTION SELECTED>CD-Roms
<OPTION>DVDs
<OPTION>Videos
<OPTION>Toys
</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:

  • SELECT tells the browser another form is going here. This time its a SELECT or Pop-Up form.
  • NAME Same as above. This is the heading of the form item. It denotes how the results of the reader will arrive at your email box. In this case it will say; "content_type=" and then the reader's choice.
  • SIZE denotes the size of the box. Here, 1 means 1 line or item is shown. Try putting two there if you'd like to see what it does. I prefer just one. More than one item tends to defeat the purpose of the Pop-Up Box.
  • OPTION SELECTED denotes which option will appear in the box. Note on the page that "CD-Roms" is visible.
  • OPTION denotes another choice that will be visible when you click on the item.
  • /SELECT finishes off the entire deal.

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).

This may be the easiest of all the items I've shown on this page. Here are the buttons:

These buttons are active and will attempt to work - however a false email address was used so I don't fill my own box with email from this tutorial. You will just get an error


And here are the commands to put the buttons on the page:

<INPUT TYPE="submit"><INPUT TYPE="reset">

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)

Final Step

Make sure you end your page with this:

</FORM>


Here's a completed form and it's corresponding script.
Your Name
Email
Reason For Contact
Status Guest Member
Comments
80 characters maximum, please


Script:

<Form Method="Post" Action="mailto:you@domain.com">
Your Name <INPUT TYPE="text" SIZE="30" NAME="name">
Email <INPUT TYPE="text" SIZE="30" NAME="email">
Reason For Contact <SELECT NAME="reason">
<option value="Broken_Link" selected>Broken Link
<option value="Complaint">Complaint
<option value="Billing">Billing
<option value="Kudos">Kudos
</SELECT>
Status
<input type="radio" Name=status Value="guest"> Guest
<input type="radio" Name=status Value="member"> Member
Comments <TEXTAREA cols="30" rows="4" wrap="physical" NAME="main_comments"></TEXTAREA>
<INPUT TYPE="submit" VALUE="Submit Application"> <INPUT TYPE="RESET" VALUE=" Clear Form ">
</Form>


That's a beginning on forms, but there is so much more you can do than what is here. There are forms you can connect to other CGI's (Common Gateway Interfaces), databases, or other data collection devises.

 

Free Resource Directory



Email Login
Password

New users
sign up!!!

  
Please link To Us!
Webmaster Resources- Free at HowAmazing.com
 


Valued Affiliates
Free Stuff Center
Java Scripts and Dhtml Scripts- Free at A1JavaScripts.com!
Clipart, animations, interfaces, and much more!

Real Resources for Real Webmasters!


Other sites in the HowAmazing.com Network...


Home  -  Swap Links/Add A Resource  -  Link To Us  -  Contact Us  Web DesignAdvertise
Looking to have your site designed by a professional? Click here to contact us.

All rights reserved, HowAmazing.com.
Reproduction in whole or in part in any form
without express written consent from HowAmazing.com is
prohibited. If you are interested in advertising on HowAmazing.com, Please
address your E-mail to advertising@howamazing.com.

Exclusive Concepts, Inc