new AddressForm(div_id, options)
An address form
Parameters:
Name | Type | Description |
---|---|---|
div_id |
string | ID of form container |
options |
JSON | Options for form customization -- Optional --
List of JSON attributes
|
- Source:
Methods
getFormJSON() → {JSON}
Get form data in JSON format and show it in debug div if the div is set
- Source:
Returns:
Form's JSON data
- Type
- JSON
hideLabels()
Hide form labels and move those labels to placeholders instead
- Source:
resetForm()
Reset form values
- Source:
setBigLabelFontFamily(family)
Set font family for big labels
Parameters:
Name | Type | Description |
---|---|---|
family |
string | Selected font family (Ex. "Times New Roman") |
- Source:
setDebugDiv(div_id)
Set div for showing form data
Parameters:
Name | Type | Description |
---|---|---|
div_id |
string | ID of a div to show form data |
- Source:
setErrorLabelFontFamily(family)
Set font family for error labels
Parameters:
Name | Type | Description |
---|---|---|
family |
string | Selected font family (Ex. "Times New Roman") |
- Source:
setLabelText(type, text)
Set label text for an input field
Parameters:
Name | Type | Description |
---|---|---|
type |
string | ID of the input field |
text |
string | Label display text |
- Source:
setLanguage(lang)
Set language of the form using javascript
Parameters:
Name | Type | Description |
---|---|---|
lang |
string | Language code ('th','en') |
- Source:
setPlaceholder(type, text)
Set placeholder text for an input field
Parameters:
Name | Type | Description |
---|---|---|
type |
string | ID of the input field |
text |
string | Placeholder display text |
- Source:
setRequired(type, bool)
Set an input field as required
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Name of the input field |
bool |
bool | "required" value |
- Source:
setSmallLabelFontFamily(family)
Set font family for small labels
Parameters:
Name | Type | Description |
---|---|---|
family |
string | Selected font family (Ex. "Times New Roman") |
- Source:
setStyle(filename)
Set style of the form using CSS
Parameters:
Name | Type | Description |
---|---|---|
filename |
string | CSS file name (including .css) |
- Source:
showLabels()
Show form labels
- Source:
unbindDebugDiv()
Unbind and stop debug div from showing form data
- Source: