Hi,
I need to create a button to check all checkboxes within a grid.
I have been browsing the web and found this code to enable me to check all checkboxes. However, can anyone give me a little assistance on how i can incrorporate this within a grid component.
Here is the code for single button. Here is the single function used inside the head tags.
Now the html part
Thanks,
Denis
I need to create a button to check all checkboxes within a grid.
I have been browsing the web and found this code to enable me to check all checkboxes. However, can anyone give me a little assistance on how i can incrorporate this within a grid component.
Here is the code for single button. Here is the single function used inside the head tags.
Code:
<SCRIPT LANGUAGE="JavaScript"> <!-- <!-- Begin function Check(chk) { if(document.myform.Check_All.value=="Check All"){ for (i = 0; i < chk.length; i++) chk[i].checked = true ; document.myform.Check_All.value="UnCheck All"; }else{ for (i = 0; i < chk.length; i++) chk[i].checked = false ; document.myform.Check_All.value="Check All"; } } // End --> </script>
Now the html part
Code:
<form name="myform" action="checkboxes.asp" method="post"> <b>Scripts for Web design and programming</b><br> <input type="checkbox" name="check_list" value="1">ASP<br> <input type="checkbox" name="check_list" value="2">PHP<br> <input type="checkbox" name="check_list" value="3">JavaScript<br> <input type="checkbox" name="check_list" value="4">HTML<br> <input type="checkbox" name="check_list" value="5">MySQL<br> <input type="button" name="Check_All" value="Check All" onClick="Check(document.myform.check_list)"> </form>
Denis
Comment