I have the following code:
<form action="" onsubmit="getSelectedPlace(this);" target="_blank">
<div class="wrap_input">
<input type="submit" id="myDiv" class="btn buy_btn" value="Done">
</div>
</form>
function getSelectedPlace(form) {
var placesID = new Array();
$(".place.green").each(function () {
placesID.push($(this).attr("id"));
});
form.action = "/Pay/Buy?places=" + placesID;
return true;
}
In the getSelectedPlace I get ID and push it in the array, and fill action.
My action:
public ActionResult Buy(string[] places)
{
return new EmptyResult();
}
In the firebug placesID is filled. But in my action places is null. If I change string[] to simple string then result is the same.
Where is a problem?
Thanks.