Form builder data submission structure

by tonytlwu

HTML

<pre id="debug"></pre>

JavaScript

function out (data) {
    document.getElementById('debug').innerHTML = JSON.stringify(data, null, "\t");
}
var formData = {
	"agree": "T",
	"info": "Form serialize in\npure javascript",
	"sport": [
		"ice_hockey",
		"football",
		"basketball"
	],
	"wish": "no",
	"job": [
		"senior_php",
		"ui_engineer",
		"web_dev"
	],
	"gender": "male",
	"email": "[email protected]",
	"password": "Krazie Bone",
	"fullname": "Dimitar Ivanov",
	"id": "32"
};

var submissionData = {
    "widget_instance_id": "382723", // This needs to be the root level widget instance ID
    "widget_nesting_path" : [
        "123123",
        "456456"
    ], // An array of nested widget instance IDs for reaching the form
    "form_data" : formData
}

// out(formData);
out(submissionData);