I am trying to use a Kendo mobile widget - switch in my web application as below:
<input id="btnConvert" type="checkbox" onclick="onChange();" />
$(document).ready()
{
$("#btnConvert").kendoMobileSwitch({
onLabel: "UK",
offLabel: "US"
});
}
function onChange(e) {
alert(e.checked);//true of false
}
But its not firing the click event. i tried the onchange event which is also not working.
Also i tried
$('input:checkbox').change(function () {
}
but no success...
Define a change
handler event in your switch
definition.
$("#btnConvert").kendoMobileSwitch({
onLabel: "UK",
offLabel: "US",
change : function (e) {
alert("You changed the value");
}
});
See the documentation here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With