rafaelrgl
asked on
i can select the items of an checkboxlist1
hi i have an checkboxlist1 and it's populate by the database, has +- 60 items, i want to create an javascript function to select the boxes or unselect or select some of it. i tryed this and did not worked. any help:
<a href="#" onclick="javascript:Select (true, 'CheckBoxList1')">Todos</a > | <a href="#" onclick="javascript:Select (false, 'CheckBoxList1')">Nenhum</ a>
<asp:CheckBoxList ID="CheckBoxList1" runat="server" DataTextField="ABREV" DataValueField="NUMBER" ></asp:CheckBoxList>
<a href="#" onclick="javascript:Select
<asp:CheckBoxList ID="CheckBoxList1" runat="server" DataTextField="ABREV" DataValueField="NUMBER" ></asp:CheckBoxList>
<script type="text/javascript">
function Select(Select, checkBoxListID){
for (var i = 0; i < 67; i++) {
document.getElementsByTagName("ContentPlaceHolder1_" + checkBoxListID + "_0").checked = Select;
}
}
</script>
in your browser, right click on your page and choose view source, post it here
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
perfect. thanks