javascript | July 10th, 2012

function checkAll(field) {
	for (i = 0; i < field.length; i++)
	field[i].checked = true;
}

<form  method="post" action="" name="myform">
<input type="checkbox" name="checkboxname[]" value="1">
<input type="checkbox" name="checkboxname[]" value="2">
<input type="checkbox" name="checkboxname[]" value="3">
<input name="CheckAll" type="button" value="Select All"  onclick="checkAll(document.myform['checkboxname[]'])" />
</form>

			
                                    
    						  

There are no comments yet, add one below.

Leave a Comment


You must be logged in to post a comment.