With questions about sending arrays to the server using jquery, there are many questions and answers.
However, I cannot find a solution to the problem that I am experiencing. Basically, the code below should return an array of identifiers to the server:
I know that the array contains elements, since the length of the array always matches the number of options selected, selected by the "true" option
var option = $(".option-select").filter(function () { return $(this).val() == "true"; }).map(function () { return this.id; }).get();
alert(option.length);
$.post("/Quote/GetOptionPrice", { myParam: option }, function (response) { $(".price").html(response); });
This is what is passed to the server:
"myParam[]"
Where am I going wrong?
source
share