CWIS Developer Documentation

- Home
- Main Page
- Namespaces
- 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
| __construct ($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
| __construct ($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 14 of file OptionFormField.php.

## Constructor & Destructor Documentation

OptionFormField::__construct | ( |  | $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 32 of file OptionFormField.php.

## Member Function Documentation

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

Get or set the length of the display field.

Parameters

  int | $NewVal | New length. (OPTIONAL)

Returns
  Current length

Definition at line 51 of file OptionFormField.php.

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 61 of file OptionFormField.php.

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

Generate HTML representing this object.

Parameters

  bool | $DisplayErrorIndicator | Whether to display error indicator. (OPTIONAL)

Definition at line 75 of file OptionFormField.php.

References FormField\Value().

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

- objects/OptionFormField.php