5
Test this
$('input[type="checkbox"]').change(function(){
this.value = (Number(this.checked));
});
5
Hello Kaushik,
Your model property isprefixchecked
is of type int?.
which is expecting either an integer value or null. So you need to cast the value to an integer before setting it to the model property
$(document).on("click", "[type='checkbox']", function (e) {
var value = this.checked ? 1 : 0;
$(this).attr("value", value);
});
Thanks
Naimish Makwana
4
Hi
Select your checkbox with Id reference.
Example:
const checkbox = document.getElementById('Is_Prefix_Checked')
checkbox.addEventListener('change', (event) => {
var value = this.checked ? 1 : 0;
$(this).attr("value", value);
})