default

Romber

Form

The ROMBER_FORM.PHP script is a generic script used to manage a web form.

On this page:

Synopsis

require_once 'romber_form.php';
 .
 .
 .
romber_handle_form ( $form_details, $form_items [, $form_steps ] );

form_details

The form_details array is a list of form level options.

form_items

The form_items array is a list of form items which are displayed as part of the web form. Each element in the array is another array which descriptionribes the form item in detail.

form_steps

The form_steps array is a list of form steps which are followed as part of the web form. Each element in the array is another array which descriptionribes the form step in detail.

Details

Callbacks

Some form options and steps may specify a callback function. The prototype for a callback is:

function callback (
  romber_form $arg_form_details,
  romber_form_step $arg_step,
  $arg_phase )

The function may change values in $arg_form_details if the argument is specified as pass by reference (i.e. &$arg_form_details).

Form Details

Each form detail option has a name and value. The following options are supported:

Option Values Usage
ajax TRUE
FALSE
Indicates whether HTML style comments in generated JavaScript should be suppressed. If TRUE such comments will be suppressed. If FALSE they will be generated. By default, FALSE is assumed.
attributes form-item-type Each form item type may have a default attribute set applied at the form level. See Item Types for more details.
twocol Some form item types such as checkbox and radioset can use a tiny internal table to hold the input element and the descriptionription in separate columns. The twocol attributes are assigned to this internal table.
buttons_at_bottom TRUE
FALSE
Indicates whether the form action buttons should be displayed at the bottom of the form. By default, TRUE is assumed. See also buttons.
buttons_at_top TRUE
FALSE
Indicates whether the form action buttons should be displayed at the top of the form. By default, FALSE is assumed. See also buttons.
callback display
execute
validate
Specifies callback routines. The display callback is used in the display phase, after the page content is generated, but before it is displayed. The validate callback is used in the input phase after the standard validation checks have been made.
clear label
url
The clear button is used in the input and confirm phases. It has a label and a target URL. The clear action restarts the entire web form. By default, the URL is the current page. The default label value is 'Clear Form'. Typical label values include 'Clear', 'Reset', 'Restart' and 'Start Again'. See button for more details.
columns Set of keywords including:
single
prompt
input
result
The columns attribute indicates which columns are displayed. By default the prompt and input columns are displayed. A single column layout is used if the number of columns is one.
confirm label
script
The confirm button is used in the input phase. It has a label and a script which is executed before the POST. The optional script is a JavaScript statement, which will abort the POST if a false value is returned. See button for more details.
construction DIV
TABLE

The construction option controls how forms are rendered in HTML. Forms may be rendered using div or table (and tr, th and td) tags. In a Romber configuration file, the following entries can control the default or required behaviour:

$romber_config['preferences']['form_construction_default'] = 'DIV';
$romber_config['preferences']['form_construction_force'] = 'DIV';
csv_file File path The csv_file option indicates that the resultant data should be written to a CSV file. The option value is the path of the CSV file. If the CSV file doesn't exists, it will be created. If it is empty, the first row will be a heading row. The heading row values will be the first non blank attribute from the list heading, description and prompt of each form item.
default_editor ckeditor
tinymce
xinha
Specifies the default editor for WYSIWYG form items. The default value is xinha.
denotes DEFAULT
DEFERRED
NONE
ROW
Specifies how to have the denotes zone. The DEFAULT behaviour is to place all denotes messages at the top of the form, possibly over multiple lines. The DEFERRED behaviour is to place required and cross validated field messages at the top of the form and oneof messages immediately before the oneof section. When NONE is specified, there will be no denotes messages displayed. The ROW behaviour is to place all denotes messages at the top of the form in a single line.
done label
url
The done button is used in the display phase. It has a label and a target URL. The URL should be specified as the done action implies that we have finished and that we should move on. See button for more details.
email_confirmation from
to
subject
Specifies that a confirmation email should be sent with a limited set of form data. Tracking data is not included. Uploaded files are not included as attachments.
email_details from
to
subject
Specifies that an email should be sent with all the form data. Uploaded files are included as attachments.
email_notification from
to
subject
Specifies that a notification email should be sent with a reduced set of form data. Uploaded files are not included as attachments.
form name
language
The web form may have a name and a language. By default, the language is English. Where possible, selection of another language will cause various messages to be displayed in the appropriate language.
h2 Text Form level 2 heading.
h3 Text Form level 3 heading.
javascript TRUE
FALSE
Specifies whether validation JavaScript should be generated. TRUE is assumed by default.
logout label The logout button is used in the display phase. It has a label. See button for more details.
messages success Specifies messages to be used when some event occurs. Currently only the success message is supported.
multicol number
table
Specifies that a multi-column form is to be generated. In this case, there is an outer table, with each column containing an inner table which has the same layout as the table used when multicol is not specified. The number value indicates the number of columns. The table value is a set of attributes which are applied to the outer table of the form.
onload JavaScript A fragment of JavaScript to include in the form onload function.
onsubmit JavaScript A fragment of JavaScript to include in the form onsubmit function.
print label The print button is used in the display phase. It has a label. See button for more details.
prompt_note cross_required The prompt note used for cross required items. The default value is '** '.
default The prompt note used for items which are not required, cross required or one of. The default value is ''.
nocolon By default prompt values have a colon appended when they don't end with a question mark. If nocolon is set to TRUE, no colons are appended. The form item attribute nocolon can be used to specify whether colons should be appended on a per item basis.
oneof The prompt note used for one of items. The default value is '+ '.
position Specifies where the prompt note is placed. The value must be NONE, PRE or POST. The default value when no position is specified is PRE. If the value is or default to PRE, the note is placed before the prompt text. If the value is POST, the note is placed after the prompt text but before any trailing colon. If the value is NONE, prompt notes will not be used.
required The prompt note used for required items. The default value is '* '.
remember TRUE
FALSE
Specifies whether values are remembered between calls. TRUE is assumed by default.
reset label
none
The reset button is used in the input and confirm phases. It has a label. By default, a reset button is generated. If none is set to TRUE, no reset button is generated. See button for more details.
submit
submit2
submit3
submit4
submit5
label
script
The submit button is used in the input phase. It has a label and a script which is executed before the POST. The optional script is a JavaScript statement, which will abort the POST if a false value is returned. The default label value is 'Submit Form'. Typical label values include 'Enter', 'Next', 'Send' and 'Submit'. See button for more details.
session IGNORE (default)
OPTIONAL
Specifies how non displayed items are stored. When OPTIONAL is specified and a meta session is active, non displayed items are stored as session variables. In all other cases, non displayed items are stored as hidden form items.
target Web page path The target attribute value specifies the URL of the page which handles the processing of the form. The default target value is blank, which indicated that the page generating the form also handles the processing. This value is primarily used to allow a variation of a form on an initial page which is subsequentially handled by a different main page.

Form Item Types

The form item array must have a type value. The following types are supported:

breakcolumn

This layout form item indicates that a new column should be started when in multi-column layout.

Example:

array ( 'type' => 'breakcolumn' )

breakgroup

This layout form item indicates that a new group should be started within the current column when in multi-column layout.

Example:

array ( 'type' => 'breakgroup' )

buttons

This layout item allows a buttons row to be included other than at the top or bottom the form. See also buttons_at_bottom and buttons_at_top.

Example:

array (
  'type' => 'buttons' )

captcha, captcha.ejeliot, captcha.google, captcha.hn, captcha.milki, captcha.pear, captcha.recaptcha and captcha.simple

This input form item requests the user to enter as text a value displayed as an image or played as a sound. There are sereval variants including captcha.ejeliot, captcha.google, captcha.milki, captcha.hn, captcha.pear, captcha.recaptcha and captcha.simple.

The captcha.ejeliot variant uses the mechanism provided by E J Eliot.

The captcha.google variant uses the mechanism provided by Google which is a variant of reCAPTCHA.

The captcha.hn variant uses the mechanism provided by Horst Nogajski.

The captcha.milki variant uses the mechanism provided by Milki.

The captcha.pear variant uses the mechanism provided by PEAR.

The captcha.recaptcha variant uses the mechanism provided by reCAPTCHA. When using the captcha.recaptcha variant, privatekey and publickey are normally required.

The captcha.simple variant uses the mechanism provided by the PHP image functions. The image is generated dynamically and consists of size characters from the character set abcdefghkmnopqrstuvwxyz (note the absense of ijl).

Example:

array (
  'type' => 'captcha.simple',
  'prompt' => 'Enter confirmation',
  'description' => 'Confirmation',
  'size' => 6,
  'required' => TRUE )

checkbox

Example:

array (
  'type' => 'checkbox',
  'name' => 'found_friend',
  'prompt' => 'Friend' )

code, code.lower, code.mixed, code.upper and postcode

This input form item allows the entry of a valid code. Valid code characters include alphanumeric characters and the underscore. The code.mixed variant which also appies when no variant is specified, allows both lower and uppercaes characters in the code. The code.lower and code.upper variants only allow lowercase or uppercase characters respectivly. The postcode variant also allows spaces.

Example:

array (
  'name' => 'some_code',
  'type' => 'code',
  'prompt' => 'Some code',
  'size' => 31 )

country

Example:

array (
  'name' => 'country',
  'type' => 'country',
  'prompt' => 'Which country?',
  'required' => TRUE )

country_zone

Example:

array (
  'name' => 'country_zone_code',
  'type' => 'country_zone',
  'prompt' => 'Province/State/Territory',
  'required' => TRUE )

creditcard

This layout item allows data entry of a 14 to 16 digit credit card number. This will work for all credit cards including American Express, Bankcard, Diners Club, MasterCard and VISA.

Example:

array (
  'type' => 'creditcard',
  'name' => 'card_number',
  'prompt' => 'Card number',
  'required' => TRUE )

creditcard.4by4

This layout item allows data entry of a 16 digit credit card number in 4 groups of 4 digits. This will work for Bankcard, MasterCard and VISA. It will not work for American Express or Diners Club.

Example:

array (
  'type' => 'creditcard.4by4',
  'name' => 'card_number',
  'prompt' => 'Card number',
  'separate' => '-',
  'required' => TRUE )

Note that the default separate attribute value is a blank space.

date.calendar

Example:

array (
  'name' => 'date_calendar',
  'type' => 'date.calendar',
  'format' => '%Y-%m-%d',
  'prompt' => 'What date to you want?',
  'required' => TRUE )

date.ddmmm.pulldown.yyyy

Example:

array (
  'name' => 'when',
  'type' => 'date.ddmmm.pulldown.yyyy',
  'prompt' => 'Date of birth',
  'required' => TRUE )

date.ddmmmyyyy.pulldown

Example:

array (
  'name' => 'when',
  'type' => 'date.ddmmmyyyy.pulldown',
  'prompt' => 'When do you want to move?',
  'required' => TRUE )

date.mmyyyy.pulldown

Example:

array (
  'name' => 'card_expiry',
  'type' => 'date.mmyyyy.pulldown',
  'prompt' => 'Card Expiry',
  'required' => TRUE )

datetime.calendar.hhmm

Example:

array (
  'name' => 'open_timestamp',
  'type' => 'datetime.calendar.hhmm',
  'prompt' => 'Opening date and time',
  'required' => TRUE )

datetime.ddmmmyyyy.pulldown.hhmm

Example:

array (
  'name' => 'open_timestamp',
  'type' => 'datetime.ddmmmyyyy.pulldown.hhmm',
  'prompt' => 'Opening date and time',
  'required' => TRUE )

dependency.begin

This layout form item indicates the beginning of a dependency block. The item which controls the dependency block must have the same item name as the block.

Example:

array ( 'type' => 'dependency.begin', 'name' => 'dependent_data' )

dependency.default

This layout form item specifies the defaut dependency value for subsequent items within a dependency block. This saves using the dependency item attribute for every item in the block.

Example:

array ( 'type' => 'dependency.default', 'value' => '2' )

dependency.end

This layout form item indicates the end of a dependency block.

Example:

array ( 'type' => 'dependency.end' )

email.address

Example:



     

file.select

Example:



     

file.upload

Example:



     

formula

Example:

array (
  'name' => 'price',
  'type' => 'formula',
  'prompt' => 'Price',
  'script' => 'romber_update ( romberform );',
  'size' => 7 )

headings

This layout item provides a list of column headings. When in multi-column layout, the headings apply to the inner columns, not the outer columns. By default there are no column headings. Normally, this item would appear before any displayable items.

Example:

array (
  'type' => 'headings',
  'valign' => 'bottom',
  'value' => array (
    array ( 'align' => 'right', 'value' => 'BEDROOMS' ),
    array ( 'align' => 'left',  'value' => 'Qty' ),
    array ( 'align' => 'center', 'value' => 'm<sup>3</sup>' )) )

hidden

Example:

array (
  'name' => 'quoted_hourly_rate',
  'type' => 'hidden',
  'prompt' => 'Hourly rate',
  'confirm' => TRUE,
  'display' => TRUE,
  'step' => 'final',
  'value' => '$50' )

info

Displays like message, otherwise behaves much like text. More specifically, info items do not use POST variables.

Example:

array (
  'name' => 'truck_type_name',
  'type' => 'info',
  'prompt' => 'Truck type',
  'step' => 'final',
  'value' => 'Large' )

itemlist

Displays a two column select list with Add, All, Remove and None buttons to move items between the excluded and included lists. The cols attribute specifies the width of each column. The rows attribute specifies the height of each column. If necessary, the columns will have vertical scroll bars. An itemlist can be ordered by position in the select array or by descriptionription.

Example:

array (
  'name' => 'colours_available',
  'type' => 'itemlist',
  'prompt' => 'Colours available',
  'step' => 'final',
  'select' => array (
    array ( 'description' => 'Black', 'value' => '000000' ),
    array ( 'description' => 'Blue', selected' => TRUE, 'value' => '0000FF' ),
    array ( 'description' => 'Cyan', 'value' => '00FFFF' ),
    array ( 'description' => 'Green', selected' => TRUE, 'value' => '00FF00' ),
    array ( 'description' => 'Magenta', 'value' => 'FF00FF' ),
    array ( 'description' => 'Red', selected' => TRUE, 'value' => 'FF0000' ),
    array ( 'description' => 'White', 'value' => 'FFFFFF' ),
    array ( 'description' => 'Yellow', 'value' => 'FFFF00' ) ),
  'cols' => 8,
  'rows' => 10 )

itemset

Displays a select list with Add and Remove buttons to add and remove items from the list. The cols attribute specifies the width of the list. The rows attribute specifies the height of the list. If necessary, the list will have a vertical scroll bar.

Example:

array (
  'name' => 'colours_available',
  'type' => 'itemset',
  'prompt' => 'Colours available',
  'step' => 'final',
  'select' => array (
    array ( 'description' => 'Black', 'value' => '000000' ),
    array ( 'description' => 'Blue', 'value' => '0000FF' ),
    array ( 'description' => 'Cyan', 'value' => '00FFFF' ),
    array ( 'description' => 'Green', 'value' => '00FF00' ),
    array ( 'description' => 'Magenta', 'value' => 'FF00FF' ),
    array ( 'description' => 'Red', 'value' => 'FF0000' ),
    array ( 'description' => 'White', 'value' => 'FFFFFF' ),
    array ( 'description' => 'Yellow', 'value' => 'FFFF00' ) ),
  'cols' => 8,
  'rows' => 10 )

merge.column

This layout form item indicates that a split column should be merged back into a single column.

Example:

array ( 'type' => 'merge.column' )

merge.rows

This layout form item indicates that split rows should be merged back into a single column.

Example:

array ( 'type' => 'merge.rows' )

message message.confirm message.display message.input

Display only. No associated value handling.

The message.phase items indicate messages only displayed during the specified phase. By default the message type is displayed in all phases. The most useful is probably message.input which proved messages specific to the input phase. These messages might contain additional helpful information for the user.

Example:

array (
  'type' => 'message',
  'value' => 'This is a message' )

null

Example:



     

number

Example:



     

oneof.begin

This layout form item indicates the beginning of a one of block.

Example:

array ( 'type' => 'oneof.begin' )

oneof.end

This layout form item indicates the end of a one of block.

Example:

array ( 'type' => 'oneof.end' )

password

This form item allows etry of a password with asterisk display of the entered characters.

Example:

array (
  'name' => 'username_password',
  'type' => 'password' )

radioset

Example:

array (
  'name' => 'card_type',
  'type' => 'radioset',
  'prompt' => 'Card Type',
  'required' => TRUE,
  'select' => array (
    array ( 'description' => 'American Express', 'value' => 'American Express' ),
    array ( 'description' => 'Bankcard', 'value' => 'Bankcard' ),
    array ( 'description' => 'Diners Club', 'value' => 'Diners Club' ),
    array ( 'description' => 'Mastercard', 'value' => 'Mastercard' ),
    array ( 'description' => 'Visa', 'value' => 'Visa' ) ))

result

Example:



     

select

Example:

array (
  'name' => 'where',
  'type' => 'select',
  'prompt' => 'Where are you moving to?',
  'select' => array (
    array ( 'description' => 'within metro Melbourne',
            'value' => 'within metro Melbourne',
            'selected' => TRUE ),
    array ( 'description' => 'Metro Melbourne to regional Victoria',
            'value' => 'Metro Melbourne to regional Victoria' ),
    array ( 'description' => 'Melbourne to interstate',
            'value' => 'Melbourne to interstate' ) ) )

sequence

Example:



     

split.column

This layout form item indicates that a single column into multiple columns. The cols attribute specifies the number of columns. The default number of columns is 2. Subsequent items are displayed top to bottom left to right until a merge.column item.

Example:

array (
'type' => 'split.column',
'cols' => 3 )

split.rows

This layout form item indicates that a single column into multiple columns. The cols attribute specifies the number of columns. The default number of columns is 2. Subsequent items are displayed left to right top to bottom until a merge.rows item.

Example:

array ( 'type' => 'split.rows' )

telephone

Example:

array (
  'name' => 'Phone',
  'type' => 'telephone',
  'prompt' => 'Phone',
  'size' => 20,
  'required' => TRUE )

text

Example:

array (
  'name' => 'account_number',
  'type' => 'text',
  'prompt' => 'Account number',
  'size' => 7,
  'required' => TRUE )

textarea

Example:

array (
	'name' => 'content',
	'type' => 'textarea',
	'editors' => 'wysiwyg',
	'prompt' => 'Content',
	'rows' => 10,
	'cols' => 60 )

time.hhmm

Example:

array (
  'name' => 'begin_time',
  'type' => 'time.hhmm',
  'prompt' => 'Commences at',
  'required' => TRUE )

time.hhmmss

Example:

array (
  'name' => 'begin_time',
  'type' => 'time.hhmmss',
  'prompt' => 'Commences at',
  'required' => TRUE )

timer

timestamp

Example:

array (
  'type' => 'timestamp',
  'name' => 'Timestamp',
  'prompt' => 'Date & Time',
  'format' => '%Y-%m-%d %H:%M' )

tracking

Return the IP address of the form submitter.

Example:

array (
  'type' => 'tracking',
  'subitems' = array (
    array ( 'item' => 'remoteaddress', 'prompt' => 'IP Address' )
  )
)

username

Example:



     

verifier

This form item request a form verifier to be used. The verifier tries to check that the form submission is not performed by a robot.

Example:

array (
  'type' => 'verifier',
  'prompt' => 'Verifier' )

viewhide.begin

This layout form item indicates the beginning of a view/hide block.

Example:

array ( 'type' => 'viewhide.begin', 'name' => 'lots_of_optional_data' )

viewhide.end

This layout form item indicates the end of a view/hide block.

Example:

array ( 'type' => 'viewhide.end' )

Form Item Attributes

Each form item array is a list of attribute names and values. The following attributes are supported:

Attribute Values Usage
alert_name Text

If the alert_name form item attribute value is not blank, it us used as the item name when displaying an alert message. If it is blank, the description, prompt title attribute value is used.

alert_required Text

If the alert_required form item attribute value is not blank, it us used as the alert message when a required field is missing, overriding any generated message based on the alert_name.

align left
center
right
button code
confirm
default
label
none
onclick
onsubmit
script
top
url
calculate always
function
initially
javascript
pre

Specifies a calculation to be executed, usually after the field is updated. The value is an array of sub-attributes.

The always sub-attribute indicates whether the calculation should always be performed when leaving the item or whether it should only be performed if the item value changes. The default value for this is FALSE.

The function sub-attribute specifies the name of a function to be called. The function is called with a single argument which is the form item object. The default value for this is blank.

The initially sub-attribute indicates whether the calculation should also be performed when the form is displayed. The default value for this is FALSE.

The javascript sub-attribute specifies a JavaScript statement to be executed. The default value for this is blank.

The pre sub-attribute indicates hether the calculation should be peformed when entering the item. The default value for this is FALSE.

cols Integer Specifies the:
confirm TRUE
FALSE

The confirm attribute is a boolean indicating whether to display the form item during the confirm phase. By default, hidden, sequence, timestamp and tracking form items are not displayed, while all other form items are.

cross_required TRUE
FALSE
Specifies whether an item has a cross requirment with another item. By default FALSE is assumed. If an item is cross required, a double asterisk (**) is added before the item prompt during the input phase.
dependency Value
Value set
Indicates the dependency value or set of values for an item. A single value may be passed as a string. A set of values is passed as an array or strings. By default, if an item is in a dependency block and doesn't specify a dependency value, the depencency value is the value of the most recent of:
description Text

Descriptionription associated with a checkbox or radioset form item. The descriptionription is placed after the actual input element. Its is also used as prompt in the display phase, if the form item has no explicit prompt.

The description for item attribute value is used as a column heading in CSV files if it isn't blank and the heading is. If both of these are blank, the prompt attribute values is used.

directory Path The directory path at the server for selecting files (see file.select) or saving uploaded files (se file.upload.
disabled TRUE
FALSE
Indicates whether the form item is disabled. A disabled form item cannot be changed by the user and its value is not retrieved from any HTTP request. By default, FALSE is assumed. See also initially_disabled.
display checkbox
yes
no

For a checkbox form item, if the display attribute is an array used during the confirm or display phases. It contains three elements. Two elements are for the two valid checkbox values, which are, by default, yes and no. The values of the checkbox value elements are the displayable forms of the checkbox. For example the yes value is displayed when the checkbox has been selected. The no value is displayed when the checkbox has not been selected. The third element, with a name of checkbox, specifies whether to actually display a disabled checkbox.

TRUE
FALSE

For other types of form item the display attribute is a boolean indicating whether to display the form item during the display phase. By default, hidden, sequence, timestamp and tracking form items are not displayed, while all other form items are.

editors ckeditor plain
tinymce
xihna
wysiwyg

Specifies which editors, if any, should be used for a textarea item.

The value specified can be a single text text editor like:

'editors' => 'wysiwyg'

or an array of text editors like:

'editors' => array (
  'plain',
  'wysiwyg' )

If an array is used, each element may be a simple text editor name or an array of options like:

'editors' => array (
  'plain',
  'wysiwyg' => array ( ... ) )

The default wysiwyg editor is xhina.

fixed TRUE
FALSE

For a split.column or split.rows item, indicates whether the resulting columns should be fixed width or not.

By default, split columns are fixed width.

format Specifies the format for displaying the item. Currently this only applies to date items. The value is in strftime format. For example, a format value of %Y-%m-%d applied to the date 20-Jul-2008 would be displayed as 2008-07-20.
future TRUE
FLSE
Specifies that a date item must have a value in the future.
has_data TRUE
FLSE
Specifies whether the form item has associated data. Only form items with data are used to populate notification and completion emails. By default, most form items types have data. The exceptions are the message and related form item types, which don't have data by default.
heading Text

The heading associated with a breakgroup form item or a CSV file column heading.

The heading for item attribute value is used as a column heading in CSV files if it isn't blank. If it is blank, the description or prompt attribute values are used.

help code Help code. Defaults to the form item name.
file Help file. Defaults to help-code_help.inc.
sizeNot currently used
span Help span tag. Defaults to an HTML span tag which opens the help popup.
textHelp text. Defaults to content of help file.
title Help title. Defaults to "Help for item-prompt".
initially_disabled TRUE
FALSE
Indicates whether the form item is initially disabled. An initially disabled form item cannot be changed by the user when the form is displayed, but form logic may re-enable the item and its value is retrieved from any HTTP request. By default, FALSE is assumed. See also disabled.
label Text

If the label form item attribute value is not blank, it us used as the label for the item during the input phase. If it is blank, the description, prompt title attribute value is used.

maxlength
merge cell
join
row
cell => Allow multiple form items to occupy the same table cell, but in separate paragraphs or lines.
join => Same as cell, but in one paragraph or line.
row => The form item spans the entire row, rather than using separate columns for the prompt and the value.
mode MANAGE
SELECT (default)
Specifies how an item popup screen works. This item attribute only applies to itemset form items. For MANAGE mode, the popup screen can handle typical management tasks such as add, modify and remove. For SELECT mode, the popup screen can only select an object. By default, SELECT mode is used.
name Name The name of the form item.
narrow FALSE
TRUE
Specifies whether item specific buttons should be placed to the side of or below the data area of an itemset item. The default value of FALSE indicates that the buttons should be placed to the side of the data area. Setting the value to TRUE indicates that the buttons should be placed below the data area.
nocolon FALSE
TRUE
Specifies whether a trailing colon may be appended to an item prompt. The default value of FALSE indicates that a colon may be appended to the prompt. Setting the value to TRUE indicates that a colon should not be appended to the prompt.
nostep Name or array of names Specifies in which form steps the form item should be inactive. By default, all form items are active in all form steps. If the value is a scalar, it specifies a single form step in which the form item is inactive. If the value is an array, each value in the array specifies the name of a form step in which the form item is inactive. When an form item in not active, it is presented in the form as a hidden value. See also the step attribute.
ordered TRUE
FALSE
Specifies whether an itemlist included option list is ordered. By default, the included list is ordered. If ordered is specified, Up, Down and Sort buttons are added to the right side of the included list.
past TRUE
FLSE
Specifies that a date item must have a value in the past.
postdesc Text Additional text which is placed after the text of the description attribute. This is used to enhance the descriptionription in the input phase. It is not used in the confirm or display phases.
predesc Text Additional text which is placed before the text of the description attribute. This is used to enhance the descriptionription in the input phase. It is not used in the confirm or display phases.
privatekey Text

A private key used for security purposes. This is currently supported for use by captcha.recaptcha.

prompt Text

The prompt or question displayed in the left column of the form.

When the prompt form item attribute is missing or the value is blank, an explicit non-breaking space is used by default, or if the form item type is checkbox, the description for item attribute will be used as an alternative.

If the form detail attribute prompt, sub-attribute nocolon is missing or false, the form item attribute nocolon is false, the form item attribute shadow is false and the prompt doesn't end with a question mark or colon, a colon is appended to the prompt.

The prompt for item attribute value is used as a column heading in CSV files if the corresponding heading and description attribute values are blank.

publickey Text

A public key used for security purposes. This is currently supported for use by captcha.recaptcha.

reenter TRUE
FALSE
Specifies whether the item should have a reenter field which is used to reduce the likelihood of incorrect data being entered in the main field. By default FALSE is assumed.
required TRUE
FALSE
Specifies whether the item must have a non blank value. By default FALSE is assumed. If an item is required, an asterisk (*) is added before the item prompt during the input phase.
result attributes size value
rows Integer Specifies the number of displayed rows for a textarea item.
select attributes *
checked *
description
postdesc
predesc
result
 attributes
 value
selected *
value
Specifies the element list for a radioset or select form item. The value is an ordered array. Each element in the array describes a radio button or select option. The attributes listed on the left are per element. The checked boolean attribute is valid for radioset form items. The attributes detail and the selected boolean attribute are valid for select form items.
separate row
TRUE
value

Specifies the separation arrangements for items which have multiple components. This includes creditcard.4by4, radioset and textarea.

If the keyword row is specified, the item components are displayed using a sub table.

If a value of TRUE is specified with a textarea form item, the text area is placed in a separate row which spans the prompt and text columns. This allows more space for JavaScript editors such as CKEditor, TinyMCE and Xinha.

shadow FALSE
TRUE
Specifies where the prompt is placed. The default value of FALSE indicates that the prompt is displayed outside the input field, either to the left in the case of a form with multiple inner columns or above in the case of a form with a single innder column. Setting the value to TRUE indicates that the prompt is displayed inside the input field and automatically removed during input.
size Integer Specifies the displayed size for a text item.
step Name or array of names Specifies in which form steps the form item should be active. By default, a form item with a step attribute is inactive in all form steps. If the value is a scalar, it specifies a single form step in which the form item is active. If the value is an array, each value in the array specifies the name of a form step in which the form item is active. When a form item in not active, it is presented in the form as a hidden value. See also the nostep attribute.
subitems code *
prompt
Specifies the tracking items for a tracking form item. The code values include:
  • localaddress
  • localhostname
  • remoteaddress
  • remotehostname
  • useragent
subtext Text

Text to be placed below the input field.

title Text

If the title form item attribute value is not blank, it us used as the title attribute for the item during the input phase. If it is blank, the description or prompt attribute value is used.

type See types for more details. All form items must have a type value.
validate javascript
message
value
Specifies the validation options for an input item. The value of the javascript option is a JavaScript statement which returns true or false depending on whether the item valur is valid. The value of the message option is the text to display when the validation fails. true or false depending on whether the item valur is valid. The value of the value option is an item type code.
valign top
middle
bottom
value Value
wildcard TRUE
FALSE
Specifies that the item value may contain wildcard characters.\ This is only relevant to code, code.lower, code.mixed, code.upper email.address and username item types.
years Integer Specifies the number of years to be displayed in a year select list. This is applicable to the date.ddmmm.pulldown.yyyy, date.ddmmmyyyy.pulldown and date.mmyyyy.pulldown item types.

Form Steps

Each form step array is a list of attribute names and values.

Some attributes may specify a callback.

The following attributes are supported:

Attribute Value Usage
begin Function name Specifies the name of a function to call at the beginning of the step. The call is made before the form is generated or displayed.
break TRUE
FALSE (default)
Specifies whether the step resets posted values upon first entry. By default, posted values are left intact. The purpose of this attribute is to force the item values to the passed value rather than taking on the posted values.
columns Set of keywords The columns attribute indicates which columns are displayed. This value overrides the form level columns attribute for a form step.
confirm TRUE
FALSE
Specifies whether the form step has a confirm phase. The confirm, reset and clear buttons are used with the confirm phase.
display TRUE
FALSE
Specifies whether the form step has a display phase. The print and done buttons are used with the display phase.
end Function name Specifies the name of a function to call at the end of the step. The call is made after the form is generated and displayed.
execute TRUE
FALSE
Specifies whether the form step has an execution phase. The exection callback is specified by the form callback attribute.
input TRUE
FALSE
Specifies whether the form step has an input phase. The submit, reset and clear buttons are used with the input phase.
middle Function name Specifies the name of a function to call in the middle of the step. The call is made after the form is generated and before it is displayed.
name Text The name of the form step. Form steps don't specifically need names, since the default progression is in sequential form step order.
validate TRUE
FALSE
Specifies whether the form step has a validation phase. By default, a form step with an input phase has a validation phase.

The followng notes apply to form steps:

Examples

 

Copyright © Corpita Pty Ltd 1987 - 2024

Developed by romber.net
Page modified on 28-Apr-2023