Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkboxes - select all

Status
Not open for further replies.

meldrape

Programmer
May 12, 2001
516
US
Greetings,

I have a form with text boxes whose value is a recordset.

<input type=checkbox name=checkbox value=oRs(&quot;name&quot;)>

I'd like to add a &quot;select all&quot; button so the user can &quot;select all&quot; but since the value is a recorset, how can they also be set to &quot;true&quot; onclick? Any thoughts on this matter would be greatly appreciated. Thanks.
 
Nevermind. I did it this way if anyone cares. Works fine.

<script language=&quot;JavaScript&quot;><!--
function checkAll(update_mem) {
for (i=0,n=update_mem.elements.length;i<n;i++)
if (update_mem.elements.name.indexOf('MemID') !=-1)
update_mem.elements.checked = true;
}
function uncheckAll(update_mem) {
for (i=0,n=update_mem.elements.length;i<n;i++)
if (update_mem.elements.name.indexOf('MemID') !=-1)
update_mem.elements.checked = false;
}

//--></script>


<input type=radio name=&quot;select&quot; onClick=&quot;if (this.checked) checkAll(this.form);&quot;><STRONG>Select All</STRONG>

<input type=radio name=&quot;select&quot; onClick=&quot;if (this.checked) uncheckAll(this.form);&quot;><STRONG>Deselect All</STRONG>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top