Hello all!
I have two asp buttons that are in the header and footer of an asp DataList, and I am trying to use javascript to disable them based off a bool variable that is set in the codebehind. Because these buttons are in the datalist I thought it would be easier to use class names to find them. I have had no luck in getting the buttons disabled though. The following is what I have come up with and attempted.


Code JavaScript:
    function SetButtonStatus() {
 
        var bb = document.getElementsByClassName('ButtonSubmit');
        for (var i = 0; i < bb.length; i++) {
 
            bb.disabled = "<%=!isQtyValid%>";
        }
    }

In the browser I am able to see that the bool variable isQtyValid is there. Is my problem with trying to getElementsByClassName? I did a check to see the length of what bb is and it returns 2 like I thought it would. Or is my problem that bb is a generic object and needs to be cast as a button?

Thanks for your time! Any tips or pointers are appreciated! If you think you need more info just let me know and I will do my best to get it to you.