1
I have these two fields checkbox
<label class="control-label col-md-3" style="text-align:left;">Tipo de Pedido</label>
<div class="col-sm-3" style="text-align:left;">
<input type="checkbox" asp-for="Produtos" onclick="checkProduto();"/>
<label asp-for="Produtos" class="control-label"></label>
<span asp-validation-for="Produtos" class="text-danger"></span>
</div>
<div class="col-sm-3" style="text-align:left;">
<input type="checkbox" asp-for="Servico" onclick="checkServico();"/>
<label asp-for="Servico" class="control-label"></label>
<span asp-validation-for="Servico" class="text-danger"></span>
</div>
But he doesn’t recognize that he’s marked, when I make one console.log($("#Produtos")); console.log($("#Servico"));
He always returns false to me, I can’t understand.
#
looking forid
and none of theinputs
has aid
defined– Roberto de Campos
Knowing if it’s marked is done with
$("#Produtos").is(":checked")
– Isac
That’s exactly what I wanted, thank you @Isac
– Mariana