CWIS Developer Documentation
List of all members
OptionFormField Class Reference

Generator for option form fields. More...

Inheritance diagram for OptionFormField:
Inheritance graph
Collaboration diagram for OptionFormField:
Collaboration graph


 __construct ($Name, $IsRequired, $Label, $Length, $Options, $ValidFunc=NULL, $ValidMsgs=NULL)
 Object constructor. More...


 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...


 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

Detailed Description

Generator for option form fields.

Definition at line 14 of file OptionFormField.php.

Constructor & Destructor Documentation

OptionFormField::__construct (   $Name,
  $ValidFunc = NULL,
  $ValidMsgs = NULL 

Object constructor.

string$NameInternal name for this option, used for html id=
bool$IsRequiredWhether or not the field is required.
string$LabelDisplay label, shown to user in generated html
int$LengthMaximum length allowed
array$OptionsNames of the options in this group
callback$ValidFuncFunction to check the validity of this field
array$ValidMsgsError 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.

int$NewValNew length. (OPTIONAL)
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.

array$NewValStrings to use for option names. (OPTIONAL)
Current list of options

Definition at line 61 of file OptionFormField.php.

OptionFormField::PrintInput (   $DisplayErrorIndicator = FALSE)

Generate HTML representing this object.

bool$DisplayErrorIndicatorWhether 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: