define a switch button in your php like below
$this->data['form']['fields']['abc'] = $form->getFieldHtml(array(
'type' => 'checkbox',
'name' => 'abc',
'value' => 1,
'checked' => false,
'style' => 'btn_switch'
));
Below is the jquery code
jQuery(function ($) {
$("#frmName_abc_layer>button").on('click', function () {
var abc_switcher = $("#frmName_abc");
if(abc_switcher.val() == "0") {
alert('Off');
} else {
alert('On');
}
});
});