FORMfields


FORMfields.fields.MultipleListField

Class MultipleListField

FormField
|
+--DropDownField
|
+--ListField
|
+--MultipleListField

public class MultipleListField
extends ListField

ListField a field used to select a multiple options from a list of options.

Since:
FORMfields v1.0

Field Summary
mixed

$maxSelections

The maximum number of slections that can be made.

mixed

$minSelections

The minimum number of slections that can be made if any selections were made.

mixed

$multiValues

True as this field can have multiple values.

Constructor Summary

MultipleListField(string name, string label, int required, array options, array values, string blankString, int height, int maxSelections, int minSelections)

Creates a new MultipleListField.

__construct(string name, string label, int required, array options, array values, string blankString, int height, int maxSelections, int minSelections)

Creates a new MultipleListField.

Method Summary
string

getEditableFieldTag()

Returns the HTML used to display the input portion of this field.

boolean

isValid()

Checks for field errors detected by this field, including a check for blank.

Field Detail

maxSelections

public mixed $maxSelections = null

The maximum number of slections that can be made.

Since:
FORMfields v3.0

minSelections

public mixed $minSelections = null

The minimum number of slections that can be made if any selections were made.

Since:
FORMfields v3.0

multiValues

public mixed $multiValues = true

True as this field can have multiple values.

Since:
FORMfields v3.0

Constructor Detail

MultipleListField

public MultipleListField(string name, string label, int required, array options, array values, string blankString, int height, int maxSelections, int minSelections)

Creates a new MultipleListField.

Parameters:
name - the name of the form field. This value must not be a SQL reserved word and should follow all the standard variable naming conventions in PHP.
label - this form field's label. The label is the printable text that is typically displayed on the left side of the field.
required - Sets whether the field must be filled in and whether it looks like it must be filled in: FORM_FIELD_REQUIRED, FORM_FIELD_NOT_REQUIRED, FORM_FIELD_LOOKS_REQUIRED or FORM_FIELD_REQUIRED_NO_LOOK
options - a string array of options
values - a string array of values that correspond with the indices of options. This parameter can also be null if you wish the values to be exactly equal to the options
blankString - the default display value of the drop down field. Defaulted to a blank string.
height - the height of the list field in rows of text
maxSelections - The maximum number of slections that can be made
minSelections - The minimum number of slections that can be made if any selections were made
See Also:
FORM_FIELD_REQUIRED
FORM_FIELD_NOT_REQUIRED
FORM_FIELD_LOOKS_REQUIRED
FORM_FIELD_REQUIRED_NO_LOOK
Since:
FORMfields v1.0
Deprecated:
deprecated as this constructor syntax is not expected in PHP 5 - will be removed once PHP 5 becomes a minimum requirement for FORMfields

Method Detail

getEditableFieldTag

public string getEditableFieldTag()

Returns the HTML used to display the input portion of this field.

Returns:
the HTML used to display the input portion of this field
Since:
FORMfields v1.0

isValid

public boolean isValid()

Checks for field errors detected by this field, including a check for blank. This method ensures that the correct number selections has been made, if the selection range was specified. If an error is detected, the setError() method is called to set the appropriate error message.

Returns:
true if there is an error or false otherwise
Since:
FORMfields v1.0

FORMfields