FORMfields


FORMfields.fields.EmailListField

Class EmailListField

FormField
|
+--TextField
|
+--TextAreaField
|
+--EmailListField

public class EmailListField
extends TextAreaField

EmailListField is a field for editing a list of email addresses. This field accepts email addresses separated by a new line, semicolon or comma that are in the form: user@example.com
User <user@example.com>
'User' <user@example.com>
user@example (if strict validation is turned off)

Since:
FORMfields v3.0

Field Summary
mixed

$maxEmails

The max number of email addresses that can be in the list.

mixed

$minEmails

The min number of email addresses that can be in the list.

Fields inherited from FORMfields.fields.TextAreaField
cols, rows
Fields inherited from FORMfields.fields.TextField
maxLength, minLength, size
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

EmailListField(string name, string label, int required, int maxEmails, int minEmails, int rows, int cols)

Creates a new EmailListField.

__construct(string name, string label, int required, int maxEmails, int minEmails, int rows, int cols)

Creates a new EmailListField.

Method Summary
array

getEmailArray()

Returns this field's value as an array of email address strings.

void

getEmailValue()

Returns a string of email addresses that can be used when sending an email.

boolean

isValid()

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

Methods inherited from FORMfields.fields.TextAreaField
getEditableFieldTag
Methods inherited from FORMfields.fields.TextField
getEditableFieldTag, isValid
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

maxEmails

public mixed $maxEmails = null

The max number of email addresses that can be in the list.

Since:
FORMfields v3.0

minEmails

public mixed $minEmails = null

The min number of email addresses that can be in the list.

Since:
FORMfields v3.0

Constructor Detail

EmailListField

public EmailListField(string name, string label, int required, int maxEmails, int minEmails, int rows, int cols)

Creates a new EmailListField.

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
maxEmails - the max number of email addresses that can be in the list or null it there is no max
minEmails - the min number of email addresses that can be in the list or null if there is no min
rows - the number of rows or height of the text area used to edit the email list
cols - the number of columns or width of the text area used to edit the email list
See Also:
FORM_FIELD_REQUIRED
FORM_FIELD_NOT_REQUIRED
FORM_FIELD_LOOKS_REQUIRED
FORM_FIELD_REQUIRED_NO_LOOK
Since:
FORMfields v3.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

getEmailArray

public array getEmailArray()

Returns this field's value as an array of email address strings.

Returns:
this field's value as an array of email address strings
Since:
FORMfields v3.0

getEmailValue

public void getEmailValue()

Returns a string of email addresses that can be used when sending an email.

Since:
FORMfields v3.0

isValid

public boolean isValid()

Checks for field errors detected by this field, including a check for blank. This method ensures that the email addresses are in one of the forms: user@example.com
User <user@example.com>
'User' <user@example.com>
The email addresses can be separated by a newline, semicolon or comma. 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