So, you want to use a form, do you?

The use of forms is essential if you want some feedback from the people who view your pages. Whether you automatically process the entered data, or just have it forwarded to you as a plain e-mail, this guide provides you with the information necessary to produce your first Geocities' form.
It is based on my Geocities' form and does not describe all of the input controls available for use. Please remember that user comments/information sent via a form are unlikely to be secure and confidential.
The main Tag is the <FORM...> </FORM> pairing. In this case, the first part should be...

<FORM ACTION="http://www.geocities.com/cgi-bin/homestead/mail.pl?username" METHOD="POST">

Obviously, replace username with your Geocities username. This will send the completed form to you as an e-mail.

The next line should be a hidden control which defines the HTML file to be displayed once the user has filled in your form. In my case, I send them here.

<INPUT TYPE="hidden" NAME="next-url" VALUE="/SiliconValley/4974/f_sent.htm">


The most useful input control is the one line text input box.

<INPUT name="name" SIZE=20>

The name property is most commonly used when the form is to be automatically processed, for example, by search engines, but, in this case, the name is used in the e-mail message as a section title. It should not contain any spaces. The size property defines the max number of characters shown in the box at one time.

An example use of text boxes...

The HTML source code. <ol>
<li>Your name: <INPUT name ="name" SIZE=20>
<li>Your e-mail adress: <INPUT name ="e-mail_address" SIZE=20>
<li>The address of your web page (if applicable): <INPUT name ="web_page_address" SIZE=40>
</ol>
The output.

  1. Your name:
  2. Your e-mail adress:
  3. The address of your web page (if applicable):


Similar to a text box is the password control. This acts in the same way, but echos asterisks to the screen instead of the typed text.

<INPUT type ="password" name="password" SIZE=8>


A checkbox is used to allow the user to select predefined items. The attribute checked causes the checkbox to be checked by default.

<INPUT type ="checkbox" name="ItemOne" checked>


A radio button is used to allow the user to select one option from several presented. All the buttons in one group must have different values, but the same name.

None<INPUT NAME="Mags" VALUE="NONE" TYPE="RADIO" CHECKED>
One<INPUT NAME="Mags" VALUE="ONE" TYPE="RADIO">
Two+<INPUT NAME="Mags" VALUE="TWO" TYPE="RADIO">

How many magazines do you buy per week?

None One Two+


For more detailed user comments, a textarea control is more useful. Similar principles as for text boxes apply to the parameters used. If the entered text excedes the boundaries of the box, scrollbars appear and more text can be entered.

The HTML source code.

<TEXTAREA NAME="comments" ROWS=8 COLS=70></TEXTAREA>

The output.


Should you want the user to pick one selection from a predefined list of responses, then a select control should be used. It produces a drop-down list of options, from which the user can select only one. The selected parameter defines the default option which is initially displayed when the page is loaded.

The HTML source code. <SELECT name ="opinion">
<OPTION>Item 1
<OPTION selected>Item 2 - default option
<OPTION>Item 3
</SELECT>
The output.


Of course, no form is complete without the 'Submit' and 'Reset' buttons. The Submit button initiates the action specified in the <FORM...> tag. In this case, it posts the form's contents to your e-mail address via the Geocities page specified.

<INPUT TYPE ="SUBMIT" VALUE ="Click to Send">

<INPUT TYPE ="RESET" VALUE ="Erase all traces">

The value text determines the text on the each button.


So, if all that has been typed correctly and uploaded to Geocities, you should receive an e-mail like this when someone completes your form.
I hope this tutorial has been of some help and that your first form will be running well soon. If you need some more information or help, please fill out my HTML Guide form and I'll get back to you ASAP.

1