Bootstrap switch button event

You can check if input is checked:

$('#switch').on('switchChange.bootstrapSwitch', function (event, state) {
    var x = $(this).data('on-text');
    var y = $(this).data('off-text');
    if($("#switch").is(':checked')) {
      $("#in0p1").val(x);
    } else {
      $("#inp1").val(y);
    }
});

$('#switch2').on('switchChange.bootstrapSwitch', function (event, state) {
    var x = $(this).data('on-text');
    var y = $(this).data('off-text');
    if($("#switch2").is(':checked')) {
      $("#inp2").val(x);
    } else {
      $("#inp2").val(y);
    }
});

JSFIDDLE