FormField
|
+--CheckboxGroupField
public class CheckboxGroupField
extends FormField
Field Summary | |
---|---|
mixed | An array of checkbox sub fields. |
mixed | The number of columns into which to format the checkboxes. |
mixed | True if the other choice should displayed. |
mixed | True if this is a multiple value field. |
mixed | A sub field for the other choice string. |
mixed | The number of rows into which to format the checkboxes. |
mixed | True if an empty sub field constitutes an invalid value. |
Fields inherited from FORMfields.fields.FormField | |
---|---|
autoPropagate, data, disableEnterHandler, displayValuesOnNewLine, editable, enabled, endingString, enterTabHandler, enterTabs, error, extraHtml, fieldBelowLabel, formError, help, hidden, htmlify, id, isData, label, labelForId, multiValues, name, required, subFieldDisplayValueSeparator, subFieldSeparator, subFieldValueSeparator, subFields, subFieldsCannotBeEmpty, trimWhitespace, validators, value, valueIsHtml |
Constructor Summary | |
---|---|
CheckboxGroupField(string name, string label, int required, array options, int rows, int cols, boolean includeOtherChoice) Creates a new CheckboxGroupField. |
|
__construct(string name, string label, int required, array options, int rows, int cols, boolean includeOtherChoice) Creates a new CheckboxGroupField. |
Method Summary | |
---|---|
string | Returns the HTML used to display the input portion of this field. |
void | Retrieves the posted field value. |
the | getSingleCheckboxTag(CheckboxField checkbox) Returns the HTML to display a single checkbox. |
array | getValue() Returns the value of this form field. |
boolean | isValid() Checks for field errors detected by this field, including a check for blank. |
void | setDbValue(string value) Sets the database value of this field. |
void | setValue(array values, mixed value) Sets the value of this field. |
public mixed $checkboxes
An array of checkbox sub fields.
public mixed $cols = null
The number of columns into which to format the checkboxes.
public mixed $includeOtherChoice = false
True if the other choice should displayed.
public mixed $multiValues = true
True if this is a multiple value field.
public mixed $otherChoice
A sub field for the other choice string.
public mixed $rows = null
The number of rows into which to format the checkboxes.
public mixed $subFieldsCannotBeEmpty = false
True if an empty sub field constitutes an invalid value.
public CheckboxGroupField(string name, string label, int required, array options, int rows, int cols, boolean includeOtherChoice)
Creates a new CheckboxGroupField.
public string getEditableFieldTag()
Returns the HTML used to display the input portion of this field.
public void getParameter()
Retrieves the posted field value. In other words, sets this field value using the appropriate values in $_REQUEST.
public the getSingleCheckboxTag(CheckboxField checkbox)
Returns the HTML to display a single checkbox.
public array getValue()
Returns the value of this form field.
public boolean isValid()
Checks for field errors detected by this field, including a check for blank. This method ensures that if the other choice is checked, that a value for other is supplied. If an error is detected, the setError() method is called to set the appropriate error message.
public void setDbValue(string value)
Sets the database value of this field. A database value can be different than the field's actual value. For example a phone number may have the value "973-746-3233" but its database value would be "9737463233"
public void setValue(array values, mixed value)
Sets the value of this field.
CheckboxGroupField is a field for editig a group of checkboxes. This field even allows you to format the group of checkboxes into several rows and columns to minimize the length of your form.