You could try using the jquery library and do something like this..
include jquery library in the html head
$(document).ready(function(){
$('input [type=hidden]').each(function(){ //captures and package all hidden elements
value = $(this).value; ///this will get the value for each of the hidden elements one at a time
///put ajax call here.. each hidden element value will be processed one at a time ...loop
});
});