The class name used for this element, could be many per type
Messages displayed to user when they are filling out field
Messages displayed to user when submitting an empty value for a required field
Messages displayed to user on completion error
protected
DOMElement
field
DOM Element.
protected
ONEGEEK.forms.form
form
The parent ONEGEEK.forms.form class
Has the field been modified?
The span to display field errors, messages, validation etc.
Current state of the field.
The image for the status icon span
The link for the status icon
Messages displayed to user on successful completion
private
void
addPopupToggle
(
DOMElement
statusLink,
DOMElement
msgSpan)
Get the function that hides/shows the message span
Applies field context information for form inputs.
Sets the fields' modified status to true.
Applies inline field validation for form inputs
Get (and create) the fields status span (field status icon)
Create and insert the required span field if option enabled.
Get the actual DOM element for this field
Get the field's modified status
Get the fields' associated message span
Highlights the field according to GValidator options
Is this a required field?
Reset the form value and state.
Set the class name that this element uses
for validation purposes.
public
void
setForm
(
DOMElement
form)
Set the parent form.
Automatically sets the label for this element.
Set the language translations for this.
Set the field's modified status
Override the default options for a class.
Set the state of the field.
Add the Icons, spans and validation events
private
void
addPopupToggle(DOMElement
statusLink, DOMElement
msgSpan)
Parameters:
statusLink
The link where the popup is
msgSpan
The span to show/hide
Parameters:
field
The FormField object
Returns:
A function to display context information to the user
Parameters:
field
The field to set the updated flag
Returns:
The function used to update the fields modified status
Parameters:
field
The FormField object
Returns:
A function to validate the field
public
void
clean()
public
void
createFieldStatusIcon()
public
void
createRequiredSpan()
public
DOMElement
getDOMElement()
Returns:
The DOM Element for this field
public
Boolean
getModified()
Returns:
The modified status of the field
public
DOMElement
getMsgSpan()
Returns:
The DOMElement message span
public
void
highlight()
public
Boolean
isRequiredField()
Returns:
The requiredness of this field
public
void
reset()
public
void
setClassName(String
classname)
Parameters:
classname
The class name that this element is using
public
void
setForm(DOMElement
form)
Parameters:
form
The parent Form ONEGEEK.forms.form element
public
Boolean
setLabel()
Returns:
The result of the label find
public
void
setLang(string
lang)
Parameters:
lang
The new language to use for the element i.e. "EN", "DE" etc.
public
void
setModified(Boolean
modified)
Parameters:
modified
The new modified status of the field
public
void
setOptions(Object
options)
Parameters:
options
The key/value pairs of options to override
public
void
setState(String
state)
Parameters:
state
The fields' state. Can be one of: ONEGEEK.forms.FIELD_STATUS_(EMPTY|OK|INFO|ERROR|RESET)
public
void
setup()
public
void
validate()
Returns:
true if there is a value, false if not