Home
Member List
Agenda
Educ Material
Free Services
Header graphic for Lesson 4
Lesson 5
See the sample form      See the code

OBJECTIVE:
Use a form to obtain input from a visitor to your website. We will need 1 tag, 7 elements, and 9 attributes. Please make reference to the form and code linked at the top of this page.

  • Tag: Form
    The Form needs to be opened and close so that it includes all the elements and attributes. It has 2 attributes - Action and Method.

    • Action - Once the form is filled and submitted, something has to process it for the human to understand. If we merely send the submission by email, we need "Action=mailto:webmaster@aol.com".
    • Method - If we send more than a couple of words, the internet can handle the content better with Method="Post".

  • Element: Text
    <Input type=text name=memname size=30 maxlength=30>
    If we want the visitor to fill in a blank of text, we use "type=text", specifying the size of the blank and the maximun number of characters it will accept.

  • Element: Check Boxes
    <Input type=checkbox name=goal1 value="Better Speaker">
    If we want the visitor to pick one or more choices, we use "type=checkbox", specifying the value for each of the choices.

  • Element: Radio Buttons
    <Input type=radio name=goal2 value="Better Speaker">
    If we want the visitor to pick one and only one choice from several choices, we use "type=radio", specifying the value for each of the choices.

  • Element: Select
    <Select name=goal3 size=1>
    <option> Better Speaker</select>

    If we want the visitor to pick a choice from a pull down menu of choices, we use "Select", specifying the number of choices the visitor can see at the same time.

  • Element: Text Area
    <textarea name=comment cols=30 rows=2></textarea>
    If we want the visitor to enter information in a larger blank, we use "Textarea", specifying the number of characters across (rows) and the number of rows.

  • Element: Submit and Reset
    <Input type=submit name=submit value="Send">
    <Input type=reset name=reset value="Never Mind">

    At the end of the form we want to give the visitor a button to click when he is ready to send the information; and a button to reset the form is he wishes to clear the form and restart. Whatever we write as "Value" will be displayed on the respective button.

    That is it!
  • The importance of the NAME and VALUE is that these are the only 2 things you get from a form. The NAME tells you which prompt he was filling; the VALUE tells you what he filled.
  • We could pretty up the form for readability sake by placing it inside a 2 column table. The first column has the prompt; the second has the fill in the blank. See the sample form and its code.
  • There are a few more elements and attributes, but mostly this is more than enough.
  • The only limit to the number of elements on a form is the time the visitor is willing to sit through the whole process.
  • Instead of an email we could have an executable script to process and format the visitors data, or even add it to an exisiting database.
  • As you can see, a website can be interactive and thus improve every day!
Assignment:
To test yourself, create a form with "Action=mailto:" - sent to your email address. Of course, it will not work unless you upload it to your ISP and you have an email application. You could even use the entire enclosed code after correcting the "Action=mailto:".