Allow only single checkbox to be checked at a time

4 posts, 0 answers
  1. jeff
    jeff avatar
    73 posts
    Member since:
    Sep 2014

    Posted 06 Nov 2014 Link to this post

    Simple in jQuery, but I haven't figured out to only allow one checkbox checked at a time (used to enable editing a specific user): I'm using the following simple jquery to enable/disable buttons:

                                        function onCheck(e) {
                                            
    if ($('input.checkTreeview').is(':checked')) {
                                                  $(
    '#addUserButton').attr('disabled', 'disabled');
                                                  $(
    '#modifyUserButton').attr('disabled', false);
                                             }
    else {
                                                  $(
    '#addUserButton').attr('disabled', false);
                                                  $(
    '#modifyUserButton').attr('disabled', 'disabled');
                                              }

                                        }


    Anything I can do here to allow only one checkbox checked at a time?
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 07 Nov 2014 Link to this post

    Hello Jeff,

    See this Dojo snippet for a way to show only one checked checkbox.

    Regards,
    Alex Gyoshev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. jeff
    jeff avatar
    73 posts
    Member since:
    Sep 2014

    Posted 07 Nov 2014 in reply to Alex Gyoshev Link to this post

    Hi Alex,
    Thank you for the response, but when I go to the dojo, I'm getting "failed to load snippet", etc.. Please feel free to paste here for the interim, thank you!
  5. jeff
    jeff avatar
    73 posts
    Member since:
    Sep 2014

    Posted 07 Nov 2014 Link to this post

    Nevermind.. Local network "issues". Anyways, worked lovely, exactly what I was after, thank you!
Back to Top
Kendo UI is VS 2017 Ready