JavaScript - How to pass array from jquery to controller using hidden element only
Asked By Madhu krishna on 06-Jul-16 09:53 AM
var jsdocids = [];
$('input:checkbox:checked').each(function () {
var isno = $.isNumeric($(this).val());
if (isno == true) {
jsdocids = $(this).val();
alert(jsdocids);
}
});
i want to pass this jsdocids [] through hidden element and send it using html.begin form post..
@using (Html.BeginForm("SaveQuestionData", "ExecutiveSummary", FormMethod.Post, new { Id = ViewBag.wizardID }))
{
<input type="hidden" id="hidocID" name="hidocID" value="jsdocids []" />
in controlller i am trying to access using form collection collection
string docIds = Convert.ToString(collection["jsdocids"]); but i am getting null.. what am i missing here?