Constructor
new Form(optionsopt)
Constructor
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
Properties
|
- Source:
Extends
- Template
Methods
appendSerializedData() → {Form}
Append serialized data
Parameters:
Type | Description |
---|---|
- Source:
Returns:
- Type
- Form
build(data) → {Form}
Build inputs from cols
Parameters:
Name | Type | Description |
---|---|---|
data |
object | Array.<object> | data for a form input |
- Source:
Returns:
- Type
- Form
clean() → {Form}
Remove all data from the form and reset it
- Source:
Returns:
- Type
- Form
initialize() → {Form}
Initialize as a clean form with
default values from the DOM
- Source:
Returns:
- Type
- Form
lockSubmit(ms)
Lock the submit button for some amount of ms
Parameters:
Name | Type | Description |
---|---|---|
ms |
number | time to lock in milliseconds |
- Source:
populateForm(data) → {Form}
Populate form fields
Parameters:
Name | Type | Description |
---|---|---|
data |
object | collection of properties whos key match an input or select name, and whos value is appropriate for that field |
- Source:
Returns:
- Type
- Form
resetForm() → {Form}
Reset the form, using populated data
or setting to default values
- Source:
Returns:
- Type
- Form
serializeForm() → {Form}
Public function to serialize the form,
as jQuery uses serialize already
- Source:
Returns:
- Type
- Form
slideToggleForm(state) → {Form}
Slide toggle the form body
Parameters:
Name | Type | Description |
---|---|---|
state |
boolean |
- Source:
Returns:
- Type
- Form
toggleButtons(state) → {Form}
Toggle the button states
Parameters:
Name | Type | Description |
---|---|---|
state |
boolean |
- Source:
Returns:
- Type
- Form
toggleForm(state) → {Form}
Toggle the form body
Parameters:
Name | Type | Description |
---|---|---|
state |
boolean |
- Source:
Returns:
- Type
- Form
validate() → {boolean}
Validate the form
- Source:
Returns:
- Type
- boolean