I am really struggling with javascript programming and need help.
I am trying to disable 6 drop down lists client side that are within a gridview. Below is my current javascript that works except for the last line where I am trying to disable one of the drop down lists. I believe the problem is because the drop down lists are in gridview and java cannot find them. How do I find them?
<script>
function EnableAndColorButtons() {
document.getElementById('<%= Submit.ClientID %>').disabled = false;
document.getElementById('<%= Submit.ClientID %>').style.background = "Lime";
document.getElementById('<%= Submit.ClientID %>').style.borderColor = "Green";
document.getElementById('<%= Cancel.ClientID %>').disabled = false;
document.getElementById('<%= Cancel.ClientID %>').style.background = "lightcoral";
document.getElementById('<%= Cancel.ClientID %>').style.borderColor = "Red";
document.getElementById('<%= InfoLbl.ClientID %>').innerHTML = '(Continue to make changes or click submit if finished)';
document.getElementById('<%= MakeChangeslbl.ClientID %>').innerHTML = 'You must click "Submit Changes" or "Cancel Changes" above before making Assignment changes below!';
//The above is working, but the below is not probaly because the drop down lists are within gridview1
document.getElementById('<%= DropDownList1.ClientID %>').disabled = true;
}
</script>
My Gridview where the drop down lists are located looks like this:
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource3" DataTextField="FullDetails" DataValueField="FullDetails" Font-Size="Medium" Height="50px" OnDataBinding="DropDownlist1_DataBinding1" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" Width="230px">
</asp:DropDownList>