new FormInput(field, form)
Class FormInput, represents any input in a form
Parameters:
Name | Type | Description |
---|---|---|
field |
Object | The input parameters |
form |
Form | The form the input is asssociated with |
Methods
-
addError(text)
-
Display an error on the input
Parameters:
Name Type Description text
string The error message to set to the input -
data(prop)
-
Get a property data of the field
Parameters:
Name Type Description prop
string the property to get the data value Returns:
The value of the property- Type
- styring
-
isValid()
-
Check the value of the field is valid
Returns:
True if the field is valid, false else- Type
- bool
-
removeError()
-
Remove the errors on the input
-
val(value)
-
Get or set the value of the field
Parameters:
Name Type Description value
string If this variable is set, it will be set to the input Returns:
The input value or the value that has been set- Type
- string