The following functions assist in adding data input fields to a form, whether in the Select section or the Criteria section:
- addCheckBoxField
The addCheckBoxField function writes an <INPUT> tag of type=CHECKBOX to a form within a document. It begins by writing a <TR> tag into the web page so it must be called within the context of an HTML <TABLE> tag (that is, within the Criteria section of a web page).
- Syntax
addCheckBoxField(fieldName,label,initValue,default)
- Parameters
- fieldNameThe name to assign to the check box, subsequently used in the query portion of request URLs and may be referenced using the ESP variable &Request.QueryString.Named.fieldName
- labelThe label to associate with this check box
- initValueThe initial value to assign to this check box (YES | NO)
- defaultThe default value to assign to this check box if the initial value is null, either YES or NO
- Example
addCheckBoxField("linenum", "Include line numbers", "YES", "YES");
- addField
The addField function writes an <INPUT> tag of type=TEXT to a form within a document. It begins by writing a <TR> tag into the web page so it must be called within the context of an HTML <TABLE> tag (that is, within the Criteria section of a web page).
- Syntax
addField(fieldName,label,maxLength,size,initValue)
- Parameters
- fieldNameThe name to assign to the field, subsequently used in the query portion of request URLs and may be referenced using the ESP variable &Request.QueryString.Named.fieldName
- labelThe label to associate with this field
- maxLengthThe maximum number of characters that may be typed in the field.
- sizeThe visible width of the text input field
- initValueThe initial value to assign to the text in this input field
- Example
addField("cmd", "Command text", 255, 30, sh users);
- addHiddenField
The addHiddenField function writes an <INPUT> tag of type=HIDDEN to a form within a document. Hidden fields are useful for setting and maintaining state information.
- Syntax
addHiddenField(fieldName,initValue)
- Parameters
- fieldNameThe name to assign to the field, subsequently used in the query portion of request URLs and may be referenced using the ESP variable &Request.QueryString.Named.fieldName
- initValueThe initial value to assign to the hidden field
- Example
addHiddenField("mode","search");
- addPasswordField
The addPasswordField function writes an <INPUT> tag of type=PASSWORD to a form within a document. It begins by writing a <TR> tag into the web page so it must be called within the context of an HTML <TABLE> tag (that is, within the Criteria section of a web page).
- Syntax
addPasswordField(fieldName,label,maxLength,size,initValue)
- Parameters
- fieldNameThe name to assign to the field, subsequently used in the query portion of request URLs and may be referenced using the ESP variable &Request.QueryString.Named.fieldName
- labelThe label to associate with this field
- maxLengthThe maximum number of characters that may be typed in the field
- sizeThe visible width of the input field
- initValueThe initial value to assign to the text in this input field
- Example
addPasswordField("opw","Old password",8,8,"");
- addRadioButtonField
The addRadioButtonField function writes an <INPUT> tag of type=RADIO to a form within a document. It begins by writing a <TR> tag into the web page so it must be called within the context of an HTML <TABLE> tag (that is, within the Criteria section of a web page).
- Syntax
addRadioButtonField(fieldName,label,value,initValue)
- Parameters
- fieldNameThe name to assign to the field, subsequently used in the query portion of request URLs and may be referenced using the ESP variable &Request.QueryString.Named.fieldName
- labelThe label to associate with this field
- valueThe value to be assigned to the field when the radio button is checked
- initValueThe value to specify if the radio button should be checked: CHECKED or null
- Example
addRadioButtonField("searchdir", "Forward", "FWD", "CHECKED");
- addTextArea
The addTextArea function writes a <TEXTAREA> tag to a form within a document. It begins by writing a <TR> tag into the web page so it must be called within the context of an HTML <TABLE> tag (that is, within the Criteria section of a web page).
- Syntax
addTextArea(fieldName,label,rows,cols,initvalue)
- Parameters
- fieldNameThe name to assign to the text area field, subsequently used in the query portion of request URLs and may be referenced using the ESP variable &Request.QueryString.Named.fieldName
- labelThe label to associate with this text area
- rowsThe number of editable lines to display
- colsThe number of monofont characters to display in the width
- initValueThe initial value to assign to the text in this text area field
- Example
addTextArea("address","Enter your address","4","","");
- buildList
The buildList function writes a <SELECT> tag to a form within a document. A <SELECT> tag displays a drop-down single-select list or a scrollable multi-select list. It begins by writing a <TR> tag into the web page so it must be called within the context of an HTML <TABLE> tag (that is, within the Criteria section of a web page).
- Syntax
buildList(itemList, selList, fieldName, mode, noentry, label, valList, events, size)
- Parameters
- itemListThe full list of items to display in the selection list
- selListA list of the selected items (upon entry into the page).
- fieldNameThe name to assign to the text area field, subsequently used in the query portion of request URLs and may be referenced using the ESP variable &Request.QueryString.Named.fieldName
- modeMulti-select or single-select: multiple | single
- noentryWhat to display if the list contains no entries:
- blank: display a blank line
- noblank: do not display anything
- string: display this string
- labelThe label to associate with this list
- valListA list of values to correspond with the itemList if the value for the items displayed in the list is different than their display text
- eventsA string of onEvent-type statements for event processing
- sizeFor a multi-select list, the number of items to display
- Example
buildList("Pizza,Chinese,Hamburgers,Sandwich,Roast Lamb,Seafood","Pizza","food","single","","My favorite food is");
- newColumn
Creates a new column within the Criteria section for the positioning of form fields and sets the alignment of the column. It begins by writing a [assign the value for TD in your book] tag into the web page so it must be called within the context of an HTML <TR> tag and must be called before adding any fields into the Criteria section.
- Syntax
newColumn(align)
- Parameters
- alignThe alignment for data within the column: left | center | right
- Example
newColumn(left);