<FORM></FORM>

Creates a user fill-out form


[HOME] [PAGE UP] [PREV PAGE] [NEXT PAGE]


Element used to mark the beginning and end of a user fill-out form.

   <html>
        <head>
        <title>Guest Book</title>
        </head>
        <body>
           .
           .
==>>      <form method="POST" enctype="text/plain" 
==>>              action="mailto:mrusk@radix.net">
          .
           .
==>>      </form>

This particular example is for a guest book entry I've used when I haven't had server access to run cgi scripts. A lot of the ISP's won't let normal users have access to the facilities to run scripts because of security concerns. If you're lucky enough to have an ISP that does then you can explore all the resources available for generating PERL or some other form of script to interact with your web pages. For now, I'll just stick to this one-way method of getting form data.

Between the tags, you are given three other elements to construct the form layout - input, select and textarea. I've saved all the juicy details on form design for the individual discussions of these elements.

HTML 3.2 Final

action
This specifies what action the browser should take when the user presses "submit". It takes the form of a URL so it kind of leaves the door open to what you can try. For my simple guest book, all I wanted it to do was e-mail the contents of the fields that the user had entered. To do this I put action="mailto:mrusk@radix.net".This worked fine with my Netscape browser since it has the built-in mail agent. But when I tried it in Microsoft's Internet Explorer it failed miserably. Instead of just quietly mailing off the results in the background, IE fired up either of the two mail packages I'd told it about (Exchange and Internet Mail - both MS products) and left me sitting there with blank compose screen. Not exactly what I had in mind so I discontinued my Guest Book. If you're into perl or some other scripting language, and have the proper server support,  then you could have specified something like action="http://www.radix.net/~mrusk/cgi-bin/guestbook.pl". This would invoke a script that would process the data and maybe even return a page acknowleding the fact.
method
There are two methods - get and post. I don't think the method is relevant unless the action specifies a URL, but I could be wrong. For my mailto I use a method of post. If you're using an action that begins with http then the methods have the following meanings. "GET" retrieves whatever information is identified by the URL. If the URL happens to be a "data producing" entity (such as a perl script) then the data that is produced will be returned. If the method is "POST" then the data is passed as being at the tailend of the URL that was put in the action attribute. The receiving computer does what it's supposed to do with the data and life goes on.
enctype
Now here's an attribute that I didn't pay attention to at first. I didn't use it and I used to get these unintelligible strings of characters enclosing good stuff. I would go through using Notepad and clean out all the garbage to get the text by itself. Then I discovered a "mailto" formatter program that I downloaded and used but it was still a real pain to have to do so much manual labor to get at a few characters of data. Finally, I saw someone's page who used the enctype attribute and the light finally came on. The default value for this attribute is "application/x-www-form-urlencoded" which means you get all the characters but any that don't fit the 7-bit model get translated into %xx. This includes spaces, punctation, just about everything but the characters. If you would like to get your answers back, one per line preceded by the label then simply put enctype="text/plain" and your problems are over. I'm sure there are other, equally impressive values but once I got this one working I quit looking.

Netscape

    Nothing special.

Microsoft Internet Explorer

    Really botches up the use of mailto as an action attribute. Guess you'll have to find one of those "freebie" guest book sites if that's what you need.

Internationalization

    Nothing special.


[HOME] [PAGE UP] [PREV PAGE] [NEXT PAGE]


The Rusk Family . . . "the Legend Continues"

Michael T. Rusk
Comments to author: mrusk@radix.net

All contents copyright © 1996, 1997 Michael T. Rusk
All rights reserved.

Revised: December 03, 1997 10:27 -0500
URL: ./htmlgd/tagform.html