FORMfields


FORMfields.fields.MonthField

Class MonthField

FormField
|
+--DropDownField
|
+--MonthField

public class MonthField
extends DropDownField

MonthField is a drop down field of months.

Since:
FORMfields v1.0

Field Summary
mixed

$ENUM_MONTHS

An array of numeric months: 1-12.

mixed

$ENUM_MONTH_NAMES

An array of month strings determined by the dateFormat.

Fields inherited from FORMfields.fields.DropDownField
OR_STRING_MAX_SIZE, blankString, fieldEnabled, height, includeNewChoice, newChoice, options, subFieldsCannotBeEmpty, values
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

MonthField(string name, string label, int required, string blankString, string dateFormat, int startMonth, int endMonth)

Creates a new MonthField.

__construct(string name, string label, int required, string blankString, string dateFormat, int startMonth, int endMonth)

Creates a new MonthField.

Method Summary
string

getDisplayValue()

Returns the month name.

Methods inherited from FORMfields.fields.DropDownField
getEditableFieldTag, getParameter, setValue
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

ENUM_MONTHS

public mixed $ENUM_MONTHS = null

An array of numeric months: 1-12.

Since:
FORMfields v1.0

ENUM_MONTH_NAMES

public mixed $ENUM_MONTH_NAMES = null

An array of month strings determined by the dateFormat.

Since:
FORMfields v1.0

Constructor Detail

MonthField

public MonthField(string name, string label, int required, string blankString, string dateFormat, int startMonth, int endMonth)

Creates a new MonthField. Populates ENUM_MONTHS and ENUM_MONTH_NAMES based on the startMonth and endMonth.

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
blankString - the default display value for each drop down field or a single space for "Month". Defaulted to a single space.
dateFormat - the format of the month options as defined by PHP's date() function. Formats currently supported: "m", "M", "m - M". Defaulted to M if dateFormat is null.
startMonth - The earliest month permitted: 1-12. Defaulted to 1 (January).
endMonth - The latest month permitted: 1-12. Defaulted to 12 (December).
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

getDisplayValue

public string getDisplayValue()

Returns the month name.

Returns:
the month name
Since:
FORMfields v2.0

FORMfields