BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
<ejs-checkbox id="checked" checked="false"> To Change Default behavior of Switch</ejs-checkbox> // Enable the checkbox to change the default behavior.
<ejs-switch id="unchecked" change="onAcceptChange"></ejs-switch>
<script>
function onAcceptChange() {
var instance = ej.base.getComponent(document.querySelector("#unchecked"), 'switch'),
checkInstance = ej.base.getComponent(document.querySelector("#checked"), 'checkbox');
if (checkInstance.checked) {
$.ajax({
//url: "Home/Index1", invalid url
url: "Home/Index", // valid url
method: "post",
success: function (result) {
instance.checked = false; // set toggle state based on your condition.
},
error: function () {
instance.checked = false;
}
});
}
}
</script>
|