Mosaic for X "Level 2" Fill-Out Form Support

Here are details about what we have implemented as "level 2" (third cut) for fill-out forms in Mosaic for X 2.0, prerelease 6 -- this is based on the current HTML+ spec with a few changes. Be sure you have prerelease 6, else many of the details herein will be wrong.

The FORM Tag

The FORM tag specifies a fill-out form within an HTML document. More than one fill-out form can be in a single document, but forms cannot be nested.

<FORM ACTION="url"> ... </FORM>

The attributes are as follows:

Inside a FORM you can have anything except another FORM. Specifically, INPUT and SELECT tags are used to specify interface elements for the form.

Forms are not automatically visually differentiated from the rest of a document. We recommend using the HR (horizontal rule) tag before and after a form to cleanly differentiate it from surround text and/or other forms.

The INPUT Tag

The INPUT tag is used to specify a simple input element inside a FORM. It is a standalone tag; it does not surround anything and there is no terminating tag -- i.e., it is used in much the same way as IMG.

In Mosaic for X, various types of INPUT tags are instantiated as Motif widgets (text entry fields, toggle buttons, pushbuttons, etc.).

The attributes to INPUT are as follows:

The SELECT Tag

Inside <FORM> ... </FORM>, any number of SELECT tags are allowed, freely intermixed with other HTML elements (including INPUT elements; see above) 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:

        <SELECT NAME="a-menu">
        <OPTION> First option.
        <OPTION> Second option.
        </SELECT>
The attributes to SELECT are as follows:

The attributes to OPTION are as follows:

Form Submission

When the submit button is pressed, the contents of the form will be assembled into a query URL that looks like this:

    action?name=value&name=value&name=value
("action" here is the URL specified by the ACTION attribute to the FORM tag, or the current document URL if no ACTION attribute was specified.)

Strange characters in any of the "name" or "value" instances will be escaped as usual; this includes "=" and "&". Note: This means that instances of "=" that separate names and values, and instances of "&" that separate name/value pairs, are not escaped.

For text and password entry fields, whatever the user typed in will be the value; if the user didn't type anything, the value will be empty but the "name=" part of the query string will still be present.

For checkboxes and radio buttons, the VALUE attribute specifies the value of a checkbox or radio button when it is checked. An unchecked checkbox is disregarded completely when assembling the query string. Multiple checkboxes can have the same NAME (and different VALUEs), if desired. Multiple radio buttons intended to have "one of many" behavior should have the same NAME and different VALUEs.

Things To Note

ISINDEX Handling

Now that we have this fancy fill-out form support, we're supporting the ISINDEX tag differently. Instead of having a browser-interface method (dialog box or text field) for entering a query, an instance of ISINDEX is instantiated as a preloaded fill-out form suitable for entering a query; the form is inlined at the location of the ISINDEX tag itself in the document.

Justification for change:

Examples

Eleven examples are available; you will need to be running Mosaic 2.0 prerelease 6 or later to actually have them show up as forms, but you can examine the raw HTML with earlier versions or other browsers:

Writing Your Own Fill-Out Form Query Engine

If you want to set up one or more query engines corresponding to fill-out forms that you create for database accesses or other purposes, you may want to take a look at NCSA httpd 1.0. One of the example programs included with NCSA httpd is a sample fill-out form server (the same server used in the examples above, actually) and will provide a good model for writing your own servers.

Comments?

Please send mail to mosaic-x@ncsa.uiuc.edu.