FORMfields


FORMfields.fields.ImageVerificationField

Class ImageVerificationField

FormField
|
+--ImageVerificationField

public class ImageVerificationField
extends FormField

ImageVerificationField is a field that uses a randomly drawn integer code to ensure that the user who completes your form is a live person and not a spam bot.

Since:
FORMfields v3.0

Field Summary
mixed

$codeField

Stores the randomly generated 6 digit integer code.

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

ImageVerificationField(string label)

Creates a new ImageVerificationField.

__construct(string label)

Creates a new ImageVerificationField.

Method Summary
string

getEditableFieldTag()

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

string

getImageTag()

Returns the HTML used to display the image tag of this field.

boolean

isValid()

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

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

codeField

public mixed $codeField

Stores the randomly generated 6 digit integer code.

Since:
FORMfields v3.0

Constructor Detail

ImageVerificationField

public ImageVerificationField(string label)

Creates a new ImageVerificationField.

Parameters:
label - the field label. Defaulted to "Image Verification".
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

__construct

public __construct(string label)

Creates a new ImageVerificationField.

Parameters:
label - the field label. Defaulted to "Image Verification".
Since:
FORMfields v3.0

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 v3.0

getImageTag

public string getImageTag()

Returns the HTML used to display the image tag of this field. This method will attempt to use the zlib extension to dynamically produce a scrambled image of a random code. If the zlib extension is not installed, this method will simply output the code as multiple images--a lot less secure.

Returns:
the HTML used to display the image tag of this field
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 entered code matches the code drawn in the verification image. 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 v3.0

FORMfields