I have this code that creates a Table that has checkboxes in it and my checkboxes have no ID, i just want them to give me the name of the current person on the row when they are checked or unchecked and I am trying to do this with a OnChecked function and it isn't working.
This is my code:
<table id="table" class="table table-bordered table-responsive table-hover table-bordered">
<tr>
<th align="center">Nome</th>
<th align="center">Envia Mensagem</th>
<th align="center">Envia Emails</th>
<th align="center">Remover</th>
</tr>
@foreach (var esp in ViewBag.Json1)
{
<tr>
<td>@esp.Nome</td>
@if (@esp.NotificacaoEmail == "True")
{
<td align="center"><input class="minimal" onclick="FillBooks(CURRENT LINE NAME);" type="checkbox" checked="checked"></td>
}
else
{
<td align="center"><input class="minimal" type="checkbox"></td>
}
@if (@esp.NotificacaoAlerta == "True")
{
<td align="center"><input class="minimal" type="checkbox" checked="checked"></td>
}
else
{
<td align="center"><input class="minimal" type="checkbox"></td>
}
<td>
<button type="button" class="btn btn-block btn-danger">Remover</button>
</td>
</tr>
}
</table>
This is my Javascript:
function myFunction(val) {
alert(val);
}
I don't get the alert when I change the Checkbox to true or false and I don't know why, can someone help me with this?