Link to home
Start Free TrialLog in
Avatar of rafaelrgl
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>
<script type="text/javascript">
 function Select(Select, checkBoxListID){    
    for (var i = 0; i < 67; i++) {
        document.getElementsByTagName("ContentPlaceHolder1_" + checkBoxListID + "_0").checked = Select;
  }
}
</script>

Open in new window

Avatar of leakim971
leakim971
Flag of Guadeloupe image

in your browser, right click on your page and choose view source, post it here
ASKER CERTIFIED SOLUTION
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rafaelrgl
rafaelrgl

ASKER

perfect. thanks