RsD0p9BK
8/12/2014 - 10:29 AM

each.js

// jQuery get values from inputs and create an array
// http://stackoverflow.com/questions/13036676/jquery-get-values-from-inputs-and-create-an-array

var values = {};
$('.activeInput').each(function() {
    values[this.name] = this.value;
});

///////////////////////////////

var values = {};
var index = 0;
$("label", ".js-nform-preview").each(function() {

    type = $("input", this).attr("type") || 0;
    if (type == "radio") type = 2; else if (type !== 0) type = 1;

    values[index] = {}
    values[index]['value'] = $("input", this).val();
    values[index]['type'] = type;
    values[index]['title'] = $(this).text();
    index++; 
});