I come with you as I would like to know how to do the following.
When I select the checkbox I generate an arrangement to save the value of the selected checkboxes, the detail is that I need to be able to link the value of the select with the value of checkbox in order to relate them in the database and subtract them from the "Pax by assign ".
in the code of the select is the following
<select class="form-control">
@{
<option>Seleccione</option>
for (int i = 1; i <= item.Pax_por_asignar; i++)
{
<option value="@i" class="opt">@i</option>
}
}
</select>
then how it could generate link both or have the javascript read both values and put them together in a JSON or something like that.
I hope you can help me, thank you very much
EDIT: JavaScript code that I use to take the value of the checkbox
<script type="text/javascript">
$(document).ready(function () {
$('#asig').on('click', function () {
var url = **********************;
var Jids = [];
$('.ckbox:checked').each(function () {
Jids.push(parseInt($(this).val()));
});
var formData = {
Cid: Jids
};
$.post(url, formData);
});
});