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. | |
Accessors | |
Name ($NewVal=NULL) | |
Get or set Name (internal name for id=) | |
IsRequired ($NewVal=NULL) | |
Get/set IsRequired. | |
Label ($NewVal=NULL) | |
Get or set the Label (display name in generated HTML) | |
Value ($NewVal=NULL) | |
Get or set the field's value. | |
IsPassword () | |
Determine if this field is a password fild. | |
Display | |
PrintField ($DisplayErrorIndicator=FALSE) | |
Print the label and generate input tags for this object. | |
PrintLabel ($DisplayErrorIndicator=FALSE) | |
Print the label for this field without generating the input tags. | |
Error Checking | |
IsInvalidValue ($Value) | |
Check the validity of the field's value. | |
GetInvalidValueMessage ($ErrorCode) | |
Map an error code from IsInvalidValue to an error message. | |
Generator for HTML form fields.
Definition at line 6 of file FormField.php.
FormField::FormField | ( | $Name, | |
$IsRequired, | |||
$Label, | |||
$ValidFunc, | |||
$ValidMsgs | |||
) |
Object Constructor.
Name | Internal name for this field, used in the HTML for id= |
IsRequired | |
Label | Display label for this field, shown to the user |
ValidFunc | A function to check the validity of input to this field The function should return 0 for valid input |
ValidMsgs | An array of error messages, corresponding to the error codes returned by ValidFunc |
Definition at line 23 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.
ErrorCode | the error code assumed to come from IsInvalidValue() |
Definition at line 152 of file FormField.php.
FormField::IsInvalidValue | ( | $Value | ) |
Check the validity of the field's value.
Definition at line 120 of file FormField.php.
References $MyValidFunc.
FormField::IsPassword | ( | ) |
Determine if this field is a password fild.
Definition at line 80 of file FormField.php.
FormField::IsRequired | ( | $NewVal = NULL | ) |
Get/set IsRequired.
NewVal | (OPTIONAL) |
Definition at line 61 of file FormField.php.
FormField::Label | ( | $NewVal = NULL | ) |
Get or set the Label (display name in generated HTML)
NewVal | (OPTIONAL) |
Definition at line 67 of file FormField.php.
FormField::Name | ( | $NewVal = NULL | ) |
Get or set Name (internal name for id=)
NewVal | New value for the object's name (OPTIONAL) |
Definition at line 52 of file FormField.php.
FormField::PrintField | ( | $DisplayErrorIndicator = FALSE | ) |
Print the label and generate input tags for this object.
DisplayErrorIndicator | TRUE to display errors with this field (OPTIONAL, default=FALSE) |
Definition at line 92 of file FormField.php.
References PrintLabel().
FormField::PrintLabel | ( | $DisplayErrorIndicator = FALSE | ) |
Print the label for this field without generating the input tags.
DisplayErrorIndicator | TRUE to display errors with this field (OPTIONAL, default=FALSE) |
Definition at line 103 of file FormField.php.
Referenced by CheckboxFormField\PrintField(), and PrintField().
FormField::Value | ( | $NewVal = NULL | ) |
Get or set the field's value.
NewVal | (OPTIONAL) |
Definition at line 74 of file FormField.php.
Referenced by OptionFormField\PrintInput().
|
protected |
Definition at line 176 of file FormField.php.
|
protected |
Definition at line 177 of file FormField.php.
|
protected |
Definition at line 175 of file FormField.php.
Referenced by FormField().
|
protected |
Definition at line 179 of file FormField.php.
Referenced by IsInvalidValue().
|
protected |
Definition at line 180 of file FormField.php.
|
protected |
Definition at line 178 of file FormField.php.