Checkbox checked value does not change

2 posts, 0 answers
  1. Rubencito
    Rubencito avatar
    1 posts
    Member since:
    Nov 2014

    Posted 14 Jul Link to this post

    Help here, the checked value of Kendo Checkbox does not change and is always assigned as 'true'. Below is the sample code:

    @(Html.Kendo().CheckBox().Name("autoValidate")
        .Checked(false)
        .Label("Auto-Validate")
        .HtmlAttributes(new { onchange = "updateMsg();" })
    )
     
    <blockquote>
        autoValidate checked value: <span id="autoValidate-value"></span>
    </blockquote>
     
    <script type="text/javascript">
        function updateMsg() {
            $('#autoValidate-value').text($('input[name=autoValidate]').val());
        }
     
        updateMsg();
    </script>

  2. Vessy
    Admin
    Vessy avatar
    1382 posts

    Posted 18 Jul Link to this post

    Hi Rubencito,

    Indeed the html value of the checkbox does not change, but you can access the changed value in a similar way:
    function updateMsg() {
        $('#autoValidate-value').text($("#autoValidate").is(':checked'));
    }

    Hope this helps.

    Regards,
    Vessy
    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top