[Javascript] turning on checkboxes

susan at plonka.com susan at plonka.com
Fri Aug 10 09:47:54 CDT 2001


I'm trying to figure out how to make a "Select All checkboxes" button
function.

The checkboxes are generated dynamically in a loop from reading a
database and their names correspond to the memberID. I don't know how
many, that's dynamic too.

I want to be able to get the checkbox names and turn them all on with
this button.

<script language="JavaScript">
	function selectAll() {
		document.members.cb1050.checked = true
	}
<script>

<body><table> <!--- SQL stuff -->
	<% do while not connMembers.eof %>
	<tr><td>
		<input type="checkbox" name="<%= connMembers(0) %>">
	</td></tr>
	<% connMembers.movenext
	Loop %>
	</table>
	
	<table width="500"><tr><td width="100%" align="center">
	<input type="button" value="Select All"	onclick="selectAll()">
	</td></tr></table>
</body>






More information about the Javascript mailing list