FORMfields


FORMfields.fields.FloatField

Class FloatField

FormField
|
+--TextField
|
+--FloatField

public class FloatField
extends TextField

FloatField is a field for editing floating point numbers.

Since:
FORMfields v1.0

Field Summary
mixed

$REGEX_FLOAT

A regular expression used to represent a floating point number.

mixed

$maxValue

The maximum value permitted.

mixed

$minValue

The minimum value permitted.

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

FloatField(string name, string label, int required, int maxLength, int minLength, int size, mixed maxValue, mixed minValue, float the)

Creates a new FloatField.

__construct(string name, string label, int required, int maxLength, int minLength, int size, mixed maxValue, mixed minValue, float the)

Creates a new FloatField.

Method Summary
boolean

isValid()

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

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

REGEX_FLOAT

public mixed $REGEX_FLOAT = "/^(-)?([0-9])*(\\.)*([0-9])*(e(-)?([0-9])+)?\$/i"

A regular expression used to represent a floating point number.

Since:
FORMfields v1.0

maxValue

public mixed $maxValue = null

The maximum value permitted.

Since:
FORMfields v1.0

minValue

public mixed $minValue = null

The minimum value permitted.

Since:
FORMfields v1.0

Constructor Detail

FloatField

public FloatField(string name, string label, int required, int maxLength, int minLength, int size, mixed maxValue, mixed minValue, float the)

Creates a new FloatField.

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
maxLength - the maximum permitted length of the text
minLength - the minimum permitted length of the text
size - the display length of the text or null
the - maximum value permitted
the - minimum value permitted
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

isValid

public boolean isValid()

Checks for field errors detected by this field, including a check for blank. This method ensures that the value is a decimal number and within the max and min value range. 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