I have been trying to send an ajax request to a php page. I have had no problems for regular HTML field data, however I am unable to figure out the correct syntax to pass a html field by name, when the name is an array.
Here is an example of what I mean:
<input type='checkbox' name='selected[]' value='my value'>
There is several of these as they are generated dynamically.
I attempt to call it as such :
$.post('myProcess.php',{exportSelected:true,myValues:$("input[name='selected[]']").val()})
.done(function(data){
console.log(data);
});
This works perfectly fine if I pass it as a single value, eg selected without there []. I am unsure how to say "pass ALL the values of selected[] if they are checked"
I have found a couple examples of posting regular javascript arrays, however this does not seem to help in this case.