-3

I am new to .net core development. I am building a form with one check box and one view component. I am using view component to have popup control in my form. That popup should have a value only when the checkbox is checked. I am unable to provide this in client validation. I am using jquery unobtrusive validators for client validation. Please help me to do this. Thanks in advance.

Sparky
  • 98,165
  • 25
  • 199
  • 285
Yallappa
  • 5
  • 2

1 Answers1

0

if you want to check that your checkbox is true , you should check with :

var checked = $('#myCheckBox').attr('checked');
if(checked){
alert("checked");
}
else{
alert("not checked");
}


<input type="checkbox" id="myCheckBox" />