Hi Ishan,
Thank you for contacting Syncfusion support
We have checked your reported query, we suspect you want to dynamically change the checkbox state. You can achieve this by changing the checkbox checked property in button click event. Please find the below code snippet:
<button class="e-btn" id="btn">Save Json</button>
@Html.EJS().CheckBox("checked").Change("onChange").Checked(true).Label("CheckBox").Render()
<script>
document.getElementById(btn).onclick = function () {
var chkboxObj = ej.base.getComponent(document.getElementById("checked"), "checkbox");
if (chkboxObj.checked) {
chkboxObj.checked = false;
}
else {
chkboxObj.checked = true;
}
}
</script>
|
Could you please check the above code snippet and let us know whether this is fulfilling your requirement?
Regards,
Saranya D