I am trying to send an array from an html page to an asp proxy (to a service), but cannot get the array to work properly.
Array Type: json
Scripting: JavaScript/jquery
var order = new Array();
for (var i = 0; i < list.length; i++) {
if (list[i].included == true)
order.push({ MarketID: list[i].marketID, Crop: list[i].crop })
}
$("#orderValue").val(order.join());
...
<form action="/hd.asp" method="post" id="hdForm">
<input type="hidden" name="order" id="orderValue" />
...
</form>
Removing the array, it works properly, but the array is required property. I have tried just sending array, using .join(), and few other things, but nothing seems to be working.
alert(order)right before you try and set the val to make sureorderis actually an array with some stuff in it. Otherwise, please elaborate on what you mean by nothing seems to be working. The form isn't submitting? There is no value for #orderValue?