Just make the image look like a checkbox, but I think the code I gave you will pretty much work with a check box too.
Stephen ----- Original Message ----- From: "Robertson-Ravo, Neil (REC)" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, October 21, 2002 5:28 PM Subject: RE: check/uncheck checkboxes > Is there one which uses a checkbox instead of an image/button? > > -----Original Message----- > From: Stephen Moretti [mailto:stephen@;cfmaster.co.uk] > Sent: 21 October 2002 17:07 > To: CF-Talk > Subject: Re: check/uncheck checkboxes > > > Neil, > > selectall = true; > > function checkAll(theForm) { > > if (selectall == true) { > selectall = false; > theForm.selectallbutton.src = "selectall_off.gif"; > } else { > selectall = true; > > theForm.selectallbutton.src = "selectall_on.gif"; > } > > for (i=0,n=theForm.elements.length;i<n;i++) > if (theForm.elements[i].name.indexOf('chkmsg') !=-1) > theForm.elements[i].checked = selectall; > } > > <input name="selectallbutton" type="image" src="selectall_on.gif" > alt="Select All" onClick="checkAll(this.form);"> > > > The selectall variable goes in global Javascript space and I _think_ I have > the code right for setting the selectallbutton image.... > > That should point you in the right direction. > > Regards > > Stephen > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm