jh_dempsey Posted May 21, 2007 Share Posted May 21, 2007 Hey All On my webpage i have 3 groups of checkboxes, all of which have names that are arrays eg uni_id[$i] , open_entrants[$j] and other_entrants[$k ($i , $j and $k will be numbers) What i need is 3 seperate Check All / Uncheck All buttons, one for each group of checkboxes. Ive managed to find the following code that checks every single box on my page. How do i make it so that it only checks the name of the checkbox group that i pass to it?? <SCRIPT LANGUAGE="JavaScript"> <!-- function checkall() { var df=document.form1.elements; for(var i=0;i<df.length;i++) { //alert(df[i].name); df[i].checked=true; } } function uncheckall() { var df=document.form1.elements; for(var i=0;i<df.length;i++) { //alert(df[i].name); df[i].checked=false; } } --> </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.