show-notice
hide-notice

Wednesday 21 August 2013

How to disable listitem checkbox via Jquery in asp.net


Introduction:

Here i will explain How to disable  listitem checkbox via Jquery in asp.net.

Description:

The CheckBoxList control creates a multiselection check box group that can be dynamically generated using data binding.but most of the problem is how to disable checkbox. here that's solution.

ASPX:

                        pickles
                        lettuce
                        tomato
                        none
                     

JS:
$(document).ready(function () {
     $('input:checkbox').click(function () {
         if ($('#none').is(':checked')) {
             $('.toppings').attr('disabled', 'disabled');
         } else {
             $('.toppings').removeAttr('disabled');
         }
         if ($('.toppings').is(':checked')) {
             $('#none').attr('disabled', 'disabled');
         } else {
             $('#none').removeAttr('disabled');
         }
     });
 });

SHARE THIS POST   

0 comments :

Post a Comment

Design by Gohilinfotech | www.gohilinfotech.blogspot.com