Documentation

getValues

derives input values from the form

array getValues( [object| function details] );

Parameters

detailsobject| functionadditional parameters (described below)

Returns

arrayreturns hash of form values: data entered by user or initial data from the value property.

See also

Example

function get_form() {
    var values = $$('myform').getValues();
    console.log(values);
}

Details

Additonal parameters

When the method is called without the arguments, all the values of this form are returned including the values of hidden and disabled fields.

Still, you can alter this behaviour:

//returns values of visible fields only
$$('myform').getValues({hidden:false});
 
//returns values of enabled fields only
$$('myform').getValues({disabled:false});
 
//excludes both hidden and disabled fields from the result
$$('myform').getValues({
    hidden:false, 
    disabled:false
});

Additionally, you can pass a loop function into the method to iterate through the form controls:

$$('myform').getValues(function(obj){
    //'obj' points to a control object
    console.log(obj.getValue());
});

Getting the value of a specific element

To get value of some specific element within the form, you should specify its name.

webix.ui({
    view:"form",
    elements: [
        {view:"text", id:"title", placeholder:"Enter film title"},
        {...},
        {view:"button", click:"get_title"}
    ]
})
 
 
function get_title() {
    var title = $$('myform').getValues().title;
    console.log(title);
}
Back to top