|
CWIS Developer Documentation
|
Generator for HTML form fields. More...

Protected Attributes | |
| $MyName | |
| $MyIsRequired | |
| $MyLabel | |
| $MyValue | |
| $MyValidFunc | |
| $MyValidMsgs | |
Setup/Initialization | |
| FormField ($Name, $IsRequired, $Label, $ValidFunc, $ValidMsgs) | |
| Object Constructor. More... | |
Accessors | |
| 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... | |
Display | |
| 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... | |
Error Checking | |
| 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... | |
Generator for HTML form fields.
Definition at line 14 of file FormField.php.
| FormField::FormField | ( | $Name, | |
| $IsRequired, | |||
| $Label, | |||
| $ValidFunc, | |||
| $ValidMsgs | |||
| ) |
Object Constructor.
| string | $Name | Internal name for this field, used in the HTML for the id attribute. |
| bool | $IsRequired | Whether the form field is required. |
| string | $Label | Display label for this field as shown to the user. |
| callback | $ValidFunc | A function to check the validity of input to this field. The function should return 0 for valid input. |
| array | $ValidMsgs | An array of error messages, corresponding to the error codes returned by $ValidFunc. |
Definition at line 32 of file FormField.php.
References $MyName.
Referenced by CheckboxFormField\CheckboxFormField(), OptionFormField\OptionFormField(), and TextFormField\TextFormField().

| FormField::GetInvalidValueMessage | ( | $ErrorCode | ) |
Map an error code from IsInvalidValue to an error message.
| int | $ErrorCode | Error code assumed to come from IsInvalidValue(). |
Definition at line 168 of file FormField.php.
| FormField::IsInvalidValue | ( | $Value | ) |
Check the validity of the form field's value.
Definition at line 136 of file FormField.php.
References $MyValidFunc.
| FormField::IsPassword | ( | ) |
Determine if this form field is a password form field.
Definition at line 94 of file FormField.php.
| FormField::IsRequired | ( | $NewVal = NULL | ) |
Get/set IsRequired.
| bool | $NewVal | TRUE to make the form field required. This parameter is optional. |
Definition at line 73 of file FormField.php.
| FormField::Label | ( | $NewVal = NULL | ) |
Get or set the form field label as shown to the user.
| string | $NewVal | New value for the form field label. |
Definition at line 80 of file FormField.php.
| FormField::Name | ( | $NewVal = NULL | ) |
Get or set the name.
In other words, the internal name for the id attribute.
| string | $NewVal | New value for the object's name. This parameter is optional. |
Definition at line 63 of file FormField.php.
| FormField::PrintField | ( | $DisplayErrorIndicator = FALSE | ) |
Print the form field label and generate input tags for this form field.
| bool | $DisplayErrorIndicator | Determines whether error associated with this form field should be displayed. Set it to TRUE to display errors. This parameter is optional and defaults to FALSE. |
Definition at line 107 of file FormField.php.
References PrintLabel().
| FormField::PrintLabel | ( | $DisplayErrorIndicator = FALSE | ) |
Print the label for this form field without generating the input tags.
| bool | $DisplayErrorIndicator | Determines whether error associated with this form field should be displayed. Set it to TRUE to display errors. This parameter is optional and defaults to FALSE. |
Definition at line 119 of file FormField.php.
Referenced by CheckboxFormField\PrintField(), and PrintField().

| FormField::Value | ( | $NewVal = NULL | ) |
Get or set the form field value.
In other words, the value attribute.
| mixed | $NewVal | New value for the form field value. This parameter is optional. |
Definition at line 88 of file FormField.php.
Referenced by OptionFormField\PrintInput().

|
protected |
Definition at line 192 of file FormField.php.
|
protected |
Definition at line 193 of file FormField.php.
|
protected |
Definition at line 191 of file FormField.php.
Referenced by FormField().
|
protected |
Definition at line 195 of file FormField.php.
Referenced by IsInvalidValue().
|
protected |
Definition at line 196 of file FormField.php.
|
protected |
Definition at line 194 of file FormField.php.