I have a bunch of inputs on a page, ie:
<input name="user[name]" />
<input name="user[phone]" />
<input name="user[email]" />
And what I’d like to do, is on submitting the form is grab all those variables of the user array and store them in a javascript array.
Ie, I would think something like this would work:
$('submit').click(function(e){
e.preventDefault;
$.each($('input[name=user*') as var) {
var user[] = this.input value etc;
}
});
But thats because I don’t know much about javascript arrays.
How is this sort of thing achieved?
Something like…