This is the view of my json result action,its consisting property ID , IsChecked checkboxes and Propery title columns .
at this view I can checked or uncheck of these check boxes .
once I select specific check boxes and click Create Brochure I want to pass those values to another controller method.
Ex: lets say I checked first two results
property ID | IsChecked
1 | True
2 | True
I want to send above values to another controller once I click, how can I do that.
this is HTML code
<table class="table">
<thead>
<tr>
<th>Property ID</th>
<th>IsChecked</th>
<th>Property Tile</th>
</tr>
</thead>
<tbody id="table"></tbody>
</table>
<table id="template" class="table" style="display: none;">
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<div style="width:50%; float:left;text-align:left"><button id="resetborchure" type="button" class="btn btn-warning submit">Reset Brochure</button> </div>
<div style="width:50%; float:left;text-align:right"><button id="createborchure" type="button" class="btn btn-danger submit" onclick="location.href='@Url.Action("Create_Brochure", "Brochure")'">Create Brochure</button> </div>
I have following json script to retrieve data from a data table
<script type="text/javascript">
var url = '@Url.Action("FetchProductProperties")';
var editUrl = '@Url.Action("Edit")';
var template = $('#template');
var table = $('#table');
$('#search').click(function () {
table.empty();
$.getJSON(url, { function (populated_data) {
$.each(populated_data, function (index, item) {
var clone = template.clone();
var cells = clone.find('td');
cells.eq(0).text(item.ID);
if (item.CheckOrNot === true)
{
cells.eq(1).html("<input type='checkbox' value='1' checked='" + item.CheckOrNot + "'>");
}
else
{
cells.eq(1).html("<input type='checkbox' value='0'>");
}
cells.eq(2).text(item.Name);
table.append(clone.find('tr'));
});
});
});
$('#resetborchure').click(function () {
table.empty();
});
</script>