Babyslam, так?
<form action="" class="addPerson">
<label for="firstName">Имя:</label>
<input type="text" name="firstName" id="firstName" />
<label for="lastName">Фамилия</label>
<input type="text" name="lastName" id="lastName" />
<label for="month">Месяц</label>
<input type="text" name="month" id="month" />
<button>Отправить</button>
</form>
<script>
var data = {
"users": [
{
"firstName": "Ray",
"lastName": "Villalobos",
"joined": {
"month": "January",
"day": 12,
"year": 2012
}
},
{
"firstName": "John",
"lastName": "Jones",
"joined": {
"month": "April",
"day": 28,
"year": 2010
}
}
]
};
document.forms[0].onsubmit = function(e) {
var inpElems = this.querySelectorAll('input[type=text]'), obj = {};
[].forEach.call(inpElems, function(item) {
obj[item.name] = item.value;
});
data.users.push(obj);
console.log(data.users);
return false;
};
</script>