Oracle WebServer User's Guide

Contents Index Home Previous Next

Form Tags

The form tags are used to create and manipulate an HTML form. Forms are used to allow interactive data exchange between a Web Browser and a CGI program.

Forms can have the following types of elements:

Note: All the hypertext procedures (HTP) shown in this section are also available as hypertext functions (HTF).

htp.formOpen

Syntax htp.formOpen (curl, cmethod);
Purpose Prints an HTML tag that starts the form. The curl value is required and is the URL of the CGI script, normally owa, to which the contents of the Form will be sent. The method is either "GET" or "POST."
Parameters curl in varchar2
cmethod in varchar2 DEFAULT 'POST'
Generates <FORM ACTION="curl" METHOD="cmethod">

htp.formClose

Syntax htp.formClose;
Purpose Prints an HTML tag that closes the <FORM> tag
Parameters none
Generates </FORM>

htp.formCheckbox

Syntax htp.formCheckbox (cname, cvalue, cchecked, cattributes);
Purpose Prints an HTML tag that inserts a checkbox which the user can toggle off or on.
Parameters cname in varchar2
cvalue in varchar2 DEFAULT 'on'
cchecked in varchar2 DEFAULT NULL
cattributes in varchar2 DEFAULT NULL
Generates <INPUT TYPE="checkbox" NAME="cname" VALUE="cvalue" CHECKED cattributes>

htp.formHidden

Syntax htp.formHidden (cname, cvalue, cattributes);
Purpose Prints an HTML tag that sends the content of a field along with a submitted form. The field is not visible to the end user.
Parameters cname in varchar2
cvalue in varchar2 DEFAULT NULL
cattributes in varchar2 DEFAULT NULL
Generates <INPUT TYPE="hidden" NAME="cname" VALUE="cvalue" cattributes>

htp.formImage

Syntax htp.formImage (cname, csrc, calign, cattributes);
Purpose Prints an HTML tag that creates an image field that can be clicked on causing the Form to be immediately submitted. The coordinates of the selected point are measured in pixels, and returned (along with other contents of the form) in two name/value pairs. The x-coordinate is submitted under the name of the field with ".x" appended, and the y-coordinate with the ".y" appended. Any value attribute is ignored. The image itself is specified by the CSRC attribute.
Parameters cname in varchar2
csrc in varchar2
calign in varchar2 DEFAULT NULL
cattributes in varchar2 DEFAULT NULL;
Generates <INPUT TYPE="image" NAME="cname" SRC="csrc" ALIGN="calign" cattributes>

htp.formPassword

Syntax htp.formPassword (cname, csize, cmaxlength, cvalue, cattributes);
Purpose Prints an HTML tag that creates a single line text entry field. Text will not be displayed as it is entered. When the user enters a password, characters are represented by asterisks on single line text entry field.
Parameters cname in varchar2
csize in varchar2
cmaxlength in varchar2 DEFAULT NULL
cvalue in varchar2 DEFAULT NULL
cattributes in varchar2 DEFAULT NULL
Generates <INPUT TYPE="password" NAME="cname" SIZE="csize" MAXLENGTH="cmaxlength" VALUE="cvalue" cattributes>

htp.formRadio

Syntax htp.formRadio (cname, cvalue, cchecked, cattributes);
Purpose Prints an HTML tag that inserts a radio button on the HTML Form. Used to create a set of radio buttons, each representing a different value, only one of which will be toggled on by the user. Each radio button field should have the same name. Only the selected radio button will generate a name/value pair in submitted data area. This will require an explicit VALUE attribute.
Parameters cname in varchar2
cvalue in varchar2
cchecked in varchar2 DEFAULT NULL
cattributes in varchar2 DEFAULT NULL
Generates <INPUT TYPE="radio" NAME="cname" VALUE="cvalue" CHECKED cattributes>

htp.formReset

Syntax htp.formReset (cvalue, cattributes);
Purpose Prints an HTML tag that creates a RESET button that, when selected, resets all the form fields to their initial values.
Parameters cvalue in varchar2 DEFAULT 'Reset'
cattributes in varchar2 DEFAULT NULL
Generates <INPUT TYPE="reset" VALUE="cvalue" cattributes>

htp.formSubmit

Syntax htp.formSubmit (cname, cvalue, cattributes);
Purpose Prints an HTML tag that creates a button that, when selected, submits the form. If a SUBMIT button is selected to submit the Form, and that button has a name attribute specified, the submit button then contributes a name/value pair to the submitted data.
Parameters cname in varchar2
cvalue in varchar2 DEFAULT 'Submit'
cattributes in varchar2 DEFAULT NULL
Generates <INPUT TYPE="submit" NAME="cname" VALUE="cvalue" cattributes>

htp.formText

Syntax htp.formText (cname, csize, cmaxlength, cvalue, cattributes);
Purpose Prints an HTML tag that creates a field for a single line of text.
Parameters cname in varchar2
csize in varchar2 DEFAULT NULL
cmaxlength in varchar2 DEFAULT NULL
cvalue in varchar2 DEFAULT NULL
cattributes in varchar2 DEFAULT NULL
Generates <INPUT TYPE="text" NAME="cname" SIZE="csize" MAXLENGTH="cmaxlength" VALUE="cvalue" cattributes>

htp.formSelectOpen

Syntax htp.formSelectOpen (cname, cprompt, nsize, cattributes);
Purpose Prints an HTML tag that begins a Select list of alternatives. Contains the attribute NAME which specifies the name that will be submitted as a name/value pair.
Parameters cname in varchar2
cprompt in varchar2 DEFAULT NULL
nsize in integer DEFAULT NULL
cattributes in varchar2 DEFAULT NULL
Generates cprompt <SELECT NAME="cname" SIZE="nsize" cattributes>
Example htp.formSelectOpen('greatest_player';
'Pick the greatest player:');
htp.formSelectOption('Messier');
htp.formSelectOption('Howe');
htp.formSelectOption('Hull');.
htp.formSelectOption('Gretzky');.
htp.formSelectClose;
generates: Pick the greatest player:
<SELECT NAME="great player">
<OPTION>Messier
<OPTION>Howe
<OPTION>Hull
<OPTION>Gretzky
</SELECT>
Note: See htp.formSelectOption and htp.formSelectClose.

htp.formSelectOption

Syntax htp.formSelectOption (cvalue, cselected, cattributes);
Purpose Prints an HTML tag that represents one choice in the Select element.
Parameters cvalue in varchar2
cselected in varchar2 DEFAULT NULL
cattributes in varchar2 DEFAULT NULL
Generates <OPTION SELECTED cattributes>cvalue See example for htp.formSelectOpen.
Example See htp.formSelectOpen.

htp.formSelectClose

Syntax htp.formSelectClose;
Purpose Prints an HTML tag that ends a Select list of alternatives.
Parameters none
Generates </SELECT>
Example See htp.formSelectOpen.

htp.formTextarea

Syntax htp.formTextarea (cname, nrows, ncolumns, calign, cattributes);
Purpose Prints an HTML tag that creates a text field that has no predefined text in the text area. Used to enable the user to enter several lines of text.
Parameters cname in varchar2
nrows in integer
ncolumns in integer
calign in varchar2 DEFAULT NULL
cattributes in varchar2 DEFAULT NULL
Generates <TEXTAREA NAME="cname" ROWS="nrows" COLS="ncolumns" ALIGN="calign" cattributes></TEXTAREA>

htp.formTextareaOpen

Syntax htp.formTextareaOpen (cname, nrows, ncolumns, calign, cattributes);
Purpose Prints an HTML tag that opens a text area where you can insert predefined text that will always appear in the text field.
Parameters cname in varchar2
nrows in integer
ncolumns in integer
calign in varchar2 DEFAULT NULL
cattributes in varchar2 DEFAULT NULL
Generates <TEXTAREA NAME="cname" ROWS="nrows" COLS="ncolumns" ALIGN="calign" cattributes>

htp.formTextareaClose

Syntax htp.formTextareaClose;
Purpose Prints an HTML tag that ends TextArea field
Parameters none
Generates </TEXTAREA>

Contents Index Home Previous Next