CWIS Developer Documentation

- Home
- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

List of all members
OptionFormField Class Reference

Generator for option form fields. More...

Inheritance diagram for OptionFormField:
[legend]
Collaboration diagram for OptionFormField:
[legend]

## Setup/Initialization
| OptionFormField ($Name, $IsRequired, $Label, $Length, $Options, $ValidFunc=NULL, $ValidMsgs=NULL)
| Object constructor. More...

## Accessors
| Length ($NewVal=NULL)
| Get or set the length of the display field. More...
| Options ($NewVal=NULL)
| Get or set the list of options displayed by this field. More...

## Display
| PrintInput ($DisplayErrorIndicator=FALSE)
| Generate HTML representing this object. More...

## Additional Inherited Members
Public Member Functions inherited from FormField
| FormField ($Name, $IsRequired, $Label, $ValidFunc, $ValidMsgs)
| Object Constructor. More...
| Name ($NewVal=NULL)
| Get or set the name. More...
| IsRequired ($NewVal=NULL)
| Get/set IsRequired. More...
| Label ($NewVal=NULL)
| Get or set the form field label as shown to the user. More...
| Value ($NewVal=NULL)
| Get or set the form field value. More...
| IsPassword ()
| Determine if this form field is a password form field. More...
| PrintField ($DisplayErrorIndicator=FALSE)
| Print the form field label and generate input tags for this form field. More...
| PrintLabel ($DisplayErrorIndicator=FALSE)
| Print the label for this form field without generating the input tags. More...
| IsInvalidValue ($Value)
| Check the validity of the form field's value. More...
| GetInvalidValueMessage ($ErrorCode)
| Map an error code from IsInvalidValue to an error message. More...
Protected Attributes inherited from FormField
| $MyName
| $MyIsRequired
| $MyLabel
| $MyValue
| $MyValidFunc
| $MyValidMsgs

## Detailed Description

Generator for option form fields.

Definition at line 16 of file OptionFormField.php.

## Member Function Documentation

OptionFormField::Length | ( |  | $NewVal = `NULL` | ) |

Get or set the length of the display field.

Parameters

  int | $NewVal | (OPTIONAL)

Returns
  Current length

Definition at line 52 of file OptionFormField.php.

OptionFormField::OptionFormField | ( |  | $Name,
|  |  | $IsRequired,
|  |  | $Label,
|  |  | $Length,
|  |  | $Options,
|  |  | $ValidFunc = `NULL`,
|  |  | $ValidMsgs = `NULL`
| ) |  |

Object constructor.

Parameters

  string | $Name | Internal name for this option, used for html id=
  bool | $IsRequired | whether or not the field is required
  string | $Label | Display label, shown to user in generated html
  int | $Length | Maximum length allowed
  array | $Options | Names of the options in this group
  callback | $ValidFunc | Function to check the validity of this field
  array | $ValidMsgs | Error messages associated with error codes from ValidFunc

Definition at line 33 of file OptionFormField.php.

References FormField\FormField().

OptionFormField::Options | ( |  | $NewVal = `NULL` | ) |

Get or set the list of options displayed by this field.

Parameters

  array | $NewVal | strings to use for option names (OPTIONAL)

Returns
  Current list of options

Definition at line 59 of file OptionFormField.php.

OptionFormField::PrintInput | ( |  | $DisplayErrorIndicator = `FALSE` | ) |

Generate HTML representing this object.

Parameters

  bool | $DisplayErrorIndicator | (OPTIONAL)

Definition at line 70 of file OptionFormField.php.

References FormField\Value().

The documentation for this class was generated from the following file:

- objects/OptionFormField.php