set Enabled = "false" to radiobuttonlist then can not toggle enable/disable

Posted by cindy on Stack Overflow See other posts from Stack Overflow or by cindy
Published on 2010-06-10T19:50:36Z Indexed on 2010/06/10 19:53 UTC
Read the original article Hit count: 218

Filed under:

I am able to use jquery toenable/disable radiobuttonlist based on the checkbox value. But the problem is that I want to disable radiobuttonlist at the first time. Then toggle its enable/disable by checkbox later. So I have But after I add: Enabled = "false" to my radiobuttonlist, the toggle of checkbox does not work.

Here is my function to toggle :

    $(function() {
        function checkBoxClicked() {

            var isChecked = $(this).is(":checked");
            var columnName = "rblColumn" + $(this).parent().attr("alt");

            if (isChecked) {
                $("#" + columnName).removeAttr("disabled");
            } else {
                $("#" + columnName).attr("disabled", "disabled");
            }

        }

        //intercept any check box click event inside the #list Div
        $(":checkbox").click(checkBoxClicked);
    });

© Stack Overflow or respective owner

Related posts about jQuery