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.
Asked
Active
Viewed 50 times
-3
1 Answers
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" />

Hossein Daneshfar
- 92
- 7