You can use radio buttons to better do what you wish.
Something like:
<input type="Radio" name="itemsselected" value="1">
<input type="Radio" name="itemsselected" value="2">
<input type="Radio" name="itemsselected" value="3">
<input type="Radio" name="itemsselected" value="4">
<input type="Radio" name="itemsselected" value="5">
This way when the 2nd one is checked the first one
becomes 'unchecked'. Thus the value is now 2.
If you must use check boxes, I would do something like:
<input type="Checkbox" name="thisbox1" value="1">
<input type="Checkbox" name="thisbox2" value="2">
<input type="Checkbox" name="thisbox3" value="3">
<input type="Checkbox" name="thisbox4" value="4">
<input type="Checkbox" name="thisbox5" value="5">
Only problem is when you test to see if thisbox1 isdefined
and insert it into the DB, what happens is if both
box 1 and 2 was checked. Thus I would use the radio buttons.
HTH
Randy
-----Original Message-----
From: Peter Benoit [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 25, 2000 9:58 AM
To: CF-Talk
Subject: checkboxes
Hi,
I have 5 checkboxes on a form, and I want to submit to a database only the
box that was checked. How can I do this?
Thanks
----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message
with 'unsubscribe' in the body to [EMAIL PROTECTED]