I have some code that looks like this that works just fine:
var info = [];
for (i = 0; i < 10; i++)
{
info[i] = $(\'#info_\' + i).val();
}
$('[id^="info_"]').each(function(){ info.push($(this).val()); });
should do
Found a solution thanks to Dogbert. All that was missing in his example was the .get()
Here is the solution i ended up using:
var info = $('[id^="info_"]').map(function () { return $(this).val(); }).get();
You can use jQuery.map
var info = $('[id^="info_"]').map(function() { return $(this).val(); } )