FORMfields


FORMfields.fields.DropDownField

Class DropDownField

FormField
|
+--DropDownField

public class DropDownField
extends FormField

DropDownField a field for selecting a single option from a drop down list of options or supplying an new option, if the new option functionality is enabled.

Since:
FORMfields v1.0

Field Summary
mixed

$OR_STRING_MAX_SIZE

The maximum length of the "Or" string.

mixed

$blankString

The default display value for the drop down field.

mixed

$fieldEnabled

Used so that just drop down portion of the field can be disabled when modifying the new choice.

mixed

$height

The height of the list field in rows of text.

mixed

$includeNewChoice

True if the new choice sub field should be displayed.

mixed

$newChoice

The sub field for entering the new choice.

mixed

$options

An array of options.

mixed

$subFieldsCannotBeEmpty

True if an empty sub field constitutes an invalid value.

mixed

$values

An array of values that correspond with the indices of options.

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

DropDownField(string name, string label, int required, array options, array values, string blankString, boolean includeNewChoice)

Creates a new DropDownField.

__construct(string name, string label, int required, array options, array values, string blankString, boolean includeNewChoice)

Creates a new DropDownField.

Method Summary
string

getEditableFieldTag()

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

void

getParameter()

Retrieves the posted field value.

void

setValue(string value)

Sets the value of this form field.

Methods inherited from FORMfields.fields.FormField
addFieldValidator, addSubField, checkForBlank, clearValue, disable, formatRequestParameter, formatText, getButtonClicked, getData, getDbValue, getDisableFieldJs, getDisableJs, getDisableLabelJs, getDisplayFieldTag, getDisplayHtmlValue, getDisplayLabelTag, getDisplayValue, getEditable, getEditableFieldTag, getEditableLabelTag, getEnabled, getError, getExtraHtml, getFieldTag, getFormError, getHelp, getHelpTag, getHidden, getHiddenFieldTag, getId, getIsData, getIsHidden, getLabel, getLabelHtml, getLabelTag, getName, getOrNull, getParameter, getRawDbValue, getRequired, getValue, isBlank, isEmpty, isValid, setAutoPropagate, setData, setDbValue, setDisplayValuesOnNewLine, setEditable, setEnabled, setEndingString, setError, setExtraHtml, setFieldBelowLabel, setFormError, setHelp, setHidden, setHtmlify, setId, setIsData, setIsHidden, setLabel, setName, setRequired, setTrimWhitespace, setValue, setValueIsHtml, validate

Field Detail

OR_STRING_MAX_SIZE

public mixed $OR_STRING_MAX_SIZE = 40

The maximum length of the "Or" string.

Since:
FORMfields v3.0

blankString

public mixed $blankString = null

The default display value for the drop down field. When the blank string is selected, the selection is considered blank.

Since:
FORMfields v1.0

fieldEnabled

public mixed $fieldEnabled = true

Used so that just drop down portion of the field can be disabled when modifying the new choice.

Since:
FORMfields v3.0

height

public mixed $height

The height of the list field in rows of text.

Since:
FORMfields v3.0

includeNewChoice

public mixed $includeNewChoice = false

True if the new choice sub field should be displayed.

Since:
FORMfields v3.0

newChoice

public mixed $newChoice

The sub field for entering the new choice.

Since:
FORMfields v3.0

options

public mixed $options = null

An array of options.

Since:
FORMfields v1.0

subFieldsCannotBeEmpty

public mixed $subFieldsCannotBeEmpty = false

True if an empty sub field constitutes an invalid value.

Since:
FORMfields v3.0

values

public mixed $values = null

An array of values that correspond with the indices of options.

Since:
FORMfields v1.0

Constructor Detail

public DropDownField(string name, string label, int required, array options, array values, string blankString, boolean includeNewChoice)

Creates a new DropDownField.

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.
includeNewChoice - true if the new choice sub field should be displayed. Defaulted to false.
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

getParameter

public void getParameter()

Retrieves the posted field value. In other words, sets this field value using the appropriate values in $_REQUEST.

Since:
FORMfields v1.0

setValue

public void setValue(string value)

Sets the value of this form field.

Parameters:
value - the new value of this field, which can be any of the drop down values or any other string if the new choice is permitted
Since:
FORMfields v1.0

FORMfields