I'm trying to create a multi dimensional array from form fields that I can loop through with jQuery and perform some calculations on the fly.
The form has an add attendee/remove attendee option and each attendee has 3 inputs so I am trying to create an array like so with the field names
attendees[0][name] = 'Name'
attendees[0][email] = 'Email'
attendees[0][type] = 'Normal'
I am using the following in jQuery to collect this array on the change event of the inputs within the form.
var values = $("input[name='attendees[]']").map(function() {
return $(this).val();
}).get();
console.log(values);
The alert is just so I know that it is working but as you can see from my fiddle, regardless of what is in the attendee fields the array is always empty.