<Form Input>

[ button | checkbox | file | hidden | image | password | radio | reset | submit | text | <textarea> | <select> | <tuple> | <continue> ]


Form input table


element type name value submits multiplicity return type

<input> button no no basic
<input> checkbox no yes list { value }
<input> file - no no basic/tuple *
<input> hidden no no basic
<input> image - yes no tuple { x, y }

<input> password no no basic
<input> radio no yes basic
<input> reset - no - -
<input> submit C yes yes basic
<input> text no no basic

<textarea> no no basic
<select> - no no basic
<select multiple> - no no list { value }
<tuple>** - no yes list { ... }
<continue>** C yes yes basic

Attribute required.
Attribute optional.
C The name is implicitly "continue".
*) The file input field may return a tuple with three strings named filename, content, and type.
**) These elements are special to <bigwig>. They are not part of standard HTML. They are compiled to other elements and JavaScript; The client never sees these elements.

multiplicity
Multiple input elements allowed with the same name (value of the name attribute).

basic
Can be either: bool, int, float, char, string, and time. An implicit coercion from type string will take place.

list
Can be either a vector or a relation, with schemas containing the mentioned attribute names (all of which are of basic type).


button
Straightforward.

checkbox
Multiple checkboxes with the same name is allowed, they will together return a list with the values of all the boxes checked.

file
May be received as either a string or a tuple with three strings named filename, content, and type. In the former case, the value received will be the name of the file the client selected. In the latter case, the tuple three fields will respectively receive the name of the file, the contents of the file, and the mime type of the file.

hidden
Straightforward.

image
Will return the x and y coordinates of the point clicked in the image as a tuple with two attributes "x" and "y". The click will cause the page to be submitted.

password
The text field always returns a basic type and is required to have a name attribute. If a value attribute is supplied, this will be the text initially present in the field.

radio
Multiple radio buttons with the same name is allowed, but as in HTML only one of them will be returned.

reset
Will cause the form to reset.

submit
Will submit the form.

text
text is the default type for form input elements. The text field always returns a basic type and is required to have a name attribute. If a value attribute is supplied, this will be the text initially present in the field.

<textarea>
Straightforward.

<select>
If the "multiple" attribute is present, the field will return a list of the options selected. If not, it will return the option selected as a basic value.

<tuple>
The tuple input field allows information of dynamically varying size to be received and collated into vectors or a relations on the server-side. Tuples baring the same name are viewed as a single input field. This extension allows multiple occurrences of the same input field name to appear in a document. When the field values are received, they are automatically transformed into tuples in a vector or a relation with corresponding schema. Since <bigwig> does not have support for higher-order relations, tuples cannot be nested.

<continue>
The continue field is added as a convenient way of submitting values. A continue field cannot have a name, instead the keyword continue is available for value reception in (show-)receive statements. The value attribute is optional, but must be received if present. The continue field has two variants "type=button" and "type=anchor" (default), controlling the appearance of the submission field. That is, whether it should be a button or a text hyperlink. The continue field is compiled into a button or an HTML anchor with embedded JavaScript that will take care of submitting the form when clicked.

Note: This will only work for JavaScript enabled browsers.


bigwig@brics.dk
Last updated: November 2, 2001
Valid HTML 4.01!