I am using the following code to retrieve form results into an array. This displays a number of checkboxes to the user based off of input from the $result_columns_c array.
foreach($result_columns_c as $key=>$value){
echo "<td width='20%'><input type='checkbox' class='input_options_sqlUpdate_a'
name='input_options_sqlUpdate_a[$value]' value='$value'> $key</td>";
}
<script>
function optionsSubmit(){
var inputs = $('.input_options_sqlUpdate_a:checked');
input_a = [].map.call(inputs, function( input ) {
return input.value;
})
$.get("../index.php", {input_sqlQuery_a:input_a, sqlQuery:'true', sqlUpdate:'true', serialize:'true'}, function(data){
$("#test").html(data);
});
}
</script>
However, this only creates an array with the values. How can I create an array with the key($value1) as well, or preferably, just retrieve the results from the form as an associative array?
return {[input.name]:input.value}