Methods


var form = new FancyForm({
  ...
})

clear

()

clear form fields.


form.clear();

destroy

()

destroy form.


form.destroy();

each

(fn: Function, [scope: Object])

Goes throw all fields.


form.each(function(field){
  ...
});

get

([key: String]): Object/Mixed

If params are empty than returns all form values.
If key is defined than returns field value.


form.get();//returns object of with all form values

form.get('age');//return field key value.

getItem

(key:String): Object

Returns form field by name(key).
Difference from get method is that get return field value/values.


form.getItem('name');//returns field

form.getItem('age');

getSubTitle

(): String

returns sub title text value.


var subTitle = form.getSubTitle();

getTitle

(): String

returns title text value.


var title = form.getTitle();

hide

()

hide form.


form.hide();

nextTab

()

Goes to next tab if form has tabs or is multipart.


form.nextTab();

on

(eventName: String, handler: Function, scope: [Object])

setting handler on form event.


form.on('change', function(o){
  
});

prevTab

()

Goes to prev tab if form has tabs or is multipart.


form.prevTab();

set

(key: String, value: Mixed)

change field value.


form.set('age', 35);

setActiveTab

(value: Number)

Change visible tab.


form.setActiveTab(2);

setSubTitle

(value: String)

Set new sub title text.


form.setSubTitle('New Sub Title');

setTitle

(value: String)

Set new title text.


form.setTitle('New Title');

show

()

show form if it was hidden.


form.show();

submit

()

submit and send form data to server.


form.submit();

un

(eventName: String, handler: Function)

unset handler on form event.


function onChange(form, o){
  ...
}

form.on('change', onChange);
...

form.un('change', onChange);