locked
How to show Kendo switch? RRS feed

  • Question

  • User-1528845285 posted
    here is my div tag:
    <div class="anwser col-md-2">
      <input data-role="switch" id="yes_no_yes" checked="checked" />
    </div>
    
    in my jQuery I need to replace the radio buttons, how do I do that, I'm new to jQuery I have:
    
    $(document).ready(function () {
            $("div.alert_text").hide();
    
            $("div.question").find(':radio').click(function () {
    
                var isValid = $(this).hasClass('True');
                var divAlert = $(this).parents('.question').find('div.alert_text');
                if (!isValid) {
                    divAlert.show()
                }
                else {
                    divAlert.hide()
                }
    
                //Enable-Disable Next Button
                if ($(":radio:checked.True").length == @Model.Count()) {
                    $("#next").prop("disabled", false).removeClass("k-state-disabled");
                }
                else {
                    $("#next").prop("disabled", true).addClass("k-state-disabled");
                }
            })
        });
    

    Friday, June 8, 2018 6:53 PM

All replies

  • User36583972 posted


    Hi bthHum,

    in my jQuery I need to replace the radio buttons, how do I do that, I'm new to jQuery I have:

    Could you upload a demo. We can download it and debugging. This will help us quickly analyze your problem.

    Besides, the Switch / Basic Usage samples may help to you.

    Best Regards,

    Yong Lu

    Monday, June 11, 2018 9:24 AM