EXAMPLE FORM

Creating Forms for your Web Pages

To create a from you simply need to include the FORM tags in your HTML document. Here is the basic format for the form section of the HTML document :

<FORM action="http://virts-jan.integrity.com/cgi-bin/mailback.pl" method="post">
...
Your input tags here
...
</FORM>

These input tags should be of the form :
<input name="variable names" type="input types" value="default value">

variable name can be any word with no spaces in it. The variable name you choose will be included in the e-mail message you receive with the information that was typed into the HTML form. There are some variables that the script recognizes as commands, a few of these are required.

Variable Names

Required

Optional

Input Types

Special Note -- Every form must have a <INPUT type="submit" value="some words"> for the form to be processed. A user must click on the button it creates in order 'submit' the form.

Additional Options

Here are some additional options besides name= and type= for the INPUT HTML tag.

Other types of input

The SELECT Tag

Inside <FORM> ... </FORM>, any number of SELECT tags are allowed, freely intermixed with other HTML elements (including INPUT and TEXTAREA elements) and text (but not additional forms). In Mosaic for X, SELECT tags are instantiated as Motif option menus and scrolled lists.

Unlike INPUT, SELECT has both opening and closing tags. Inside SELECT, only a sequence of OPTION tags -- each followed by an arbitrary amount of plain text (no HTML markup) -- is allowed; for example:

      <SELECT NAME="a-menu">
      <OPTION value="first option">First option.</OPTION>
      <OPTION value="second option">Second option.</OPTION>
      </SELECT>

The attributes to SELECT are as follows:

The attributes to OPTION are as follows:

The TEXTAREA Tag

The TEXTAREA tag can be used to place a multiline text entry field with optional default contents in a fill-out form. The attributes to TEXTAREA are as follows:

TEXTAREA fields automatically have scrollbars; any amount of text can be entered in them.

The TEXTAREA element requires both an opening and a closing tag. A TEXTAREA with no default contents looks like this:

<TEXTAREA NAME="foo" ROWS=4 COLS=40></TEXTAREA>

A TEXTAREA with default contents looks like this:

<TEXTAREA NAME="foo" ROWS=4 COLS=40> Default contents go here. </TEXTAREA>

Newlines are respected (so in the above example there will be a newline both before and after "Default contents go here.").





EXAMPLE FORM

<HTML>
<TITLE>Mailback Sample Form</TITLE>
<BODY>
<FORM ACTION="http://virts-jan.integrity.com/cgi-bin/mailback.pl" METHOD="POST">
<INPUT TYPE="HIDDEN" NAME="mailitto" VALUE="johndoe@integrity.com">
<INPUT TYPE="HIDDEN" NAME="returnurl" VALUE="/~johndoe/mypage.html">
<INPUT TYPE="HIDDEN" NAME="returntext" VALUE="Back to my Home Page.">
<INPUT TYPE="HIDDEN" NAME="showreport">
Your Name: <INPUT TYPE="TEXT" NAME="namefrom" SIZE=35><BR>
Your Email Address: <INPUT TYPE="TEXT" NAME="mailfrom" SIZE=35><BR>
Subject: <INPUT TYPE="TEXT" NAME="subject" SIZE=35><P>
Your Message:<BR>
<TEXTAREA NAME="message" ROWS="10" COLS="60"></TEXTAREA><P>
<INPUT TYPE="RESET" VALUE="Clear Form">
<INPUT TYPE="SUBMIT" VALUE="Send Mail">
</FORM>
</BODY>
</HTML>