Lesson 12. Get interactive with forms.

purple question mark Say What purple question mark

pic of a man who does'nt have a clue!What does the 'gibberish' mean?



pic of a form <form action="/cgi-bin/form/getmail.pl" method="post"> </form>

  • The first thing you need when creating a form is a pair of FORM TAGS. <form></form>
  • Then, you tell the computer what you want it to do with your form's 'stuff'.

action="/cgi-bin/form/getmail.pl"
action="mailto:your e-mail address"
For non-users of our User Homepage Service!

  1. action="/cgi-bin/form/getmail.pl"
    The replies in your form will be posted to your mail address in our User Homepage Service.
    http://given server name/your particular address
  2. action="mailto:your e-mail address"
    The visitor's reply's in your form will be posted to your e-mail address using the "mailto:" command. Remember, the "mailto:" command from lesson 5?

    method="post"

  3. This tells the computer that it needs to use the method POST when sending the form's 'stuff' to you.
    And that's all I have to say about that....
back arrow link


    pic of a formvalue=" /reply.html"
  • This is essential for your form to work. It is the transmission completion screen file name. In plain language it is the name of the "thank you page" that appears after the visitor to your page has clicked the "send/transmit" button on your form.
  • You probably have'nt made the thank you page yet, but after you have finished putting the form where on your page you want, you will need to make a brand new page and save it as "reply.html" in the same folder as the page your form is saved in.

    If you save "reply.html" in a sub folder/directory in your site, then this sub folder's name has to be included in the value direction.
    value="/subfolder's name in which you saved "reply.html"/reply.html"
    For more on this go back to the previous page and check out part B, "Now, say thanks!".

back arrow link


    pic of a form value="My homepage"
  • By setting the value as "My Homepage", messages sent to me from this form are titled, "my homepage" Thus, if I had more than one form in operation posting messages to one mail address, I could tell which form the message was being sent from.
  • Don't set the value attribute here and the message sent to you will be titled, "From Web Visitor".
back arrow link


    pic of a formTitles/sub-headings in your form.
  • Depending on what information you want visitors to your page to send, your forms title and sub headings within your form can be anything you want.
back arrow link


    pic of a form "Your name" and "Your e-mail"

  • The 2 boxes below are called "text boxes".
    As you can see, they're simply basic boxes that allow for one line of text.
    In front of both text boxes is a caption ; "Your Name" and "Your e-mail".
    These captions indicate what information you want people to put in the text box.
    Your name
    Your e-mail
  • If you click your mouse in the box you can write something.
back arrow link


pic of a form Text Boxes

<input type="text" name="name" size="30">
<input type="text" name="e-mail" size="30">

    Remember these text boxes?
    Your name
    Your e-mail

    The code above creates the boxes alone without the blue, "Your name" / "Your e-mail" captions. Let's take the code apart and see what each command actually means.

  1. input type="text"
    Input type tells the computer that a form item is going to be placed here.
    In this case, the form item is - wait for it baby - TEXT!
    Seems kind of obvious really. Of course the person responding to the form is going to 'input text' Da!

  2. name="name" / input name="e-mail".
    Name is a "ONE WORD" heading you give each individual text box in your form. It will be included in the message that is returned to you as a title so you can keep clear what directions people are responding to. When visitors send the form to you and you get the mail, you don't see the same clear form with titles and captions that was on your page. You only receive their answers. That's pure text baby. Yeah! (Sorry, too much Austin Powers.)

    Mail that comes to me from the above 2 text boxes will say:
    name=(whatever my visitor writes in the box)
    e-mail=(whatever my visitor writes in the box)

    This way I don't get confused. I know that the answers were typed in the text boxes I called, "name" and "e-mail". Call each text box whatever it is you want your visitor to tell you. If you want someone's address, put name="address" in your input tag. If you're using the text box to get someone's age, call it "age". etc., etc.

  3. size="30"
    This means that my text box will be 30 characters long.
    You can change this number and make the box however long you like.

back arrow link


pic of a form <textarea cols=45 name=feedback rows=6>

</textarea>

  1. <textarea> </textarea>

  2. The 'textarea' tag makes a box in which the visitor to your page can type copious amounts of text.
  3. cols="?"

  4. This sets how many columns wide you want the form's textarea box to be.
    My form's textarea box is 45 colums wide.
  5. rows="?"

  6. This sets how many rows high you want the form's textarea box to be.
    My form's textarea box is 6 rows high.
  7. name=feedback

  8. Comments or feedback about a Website is one common use for textarea boxes in forms.

back arrow link


pic of a form <input type="submit" value="send your thoughts.">

</input>

  1. type="submit"

  2. This creates the button people click when they want to send their message to you.
  3. value="send your thoughts."

  4. The value attribute sets the message you want your 'send' button to display."
    If you don't include value="?", a 'send' button will still be created but it will depend on the browser you are using as to what it looks like and what title it has.
    I gave mine the title, "send your thoughts".

back arrow link


pic of a form <input type="reset" value="clear your thoughts.">

</input>

  1. input type="reset"

  2. Make a boo boo, or don't like what you've written? The reset will clear your message so you can start over.
  3. value="clear your thoughts."

  4. The value attribute sets the message you want your 'reset' button to display."
    If you don't include value="?", a 'reset' button will still be created but it will depend on the browser you are using as to what it looks like and what title it has.
    I gave mine the title, "clear your thoughts".

back arrow link