Checkboxes (in any form submission) are for MULTIPLE values:
They allow a user to choose "A" and "B" and "C"... or "A" and "C"... or "B" and "C"... (etc).
... so you cannot FORCE a single selection with checkboxes.
You can only force selections where there are several values, but only one can be selected - and this then applies to dropdowns and radio buttons.
To FORCE a selection, one creates a "DISPLAY ONLY" OPTION VALUE in any given dropdown/radio-button value set. You make this the DEFAULT value, and it is also a good idea to give it the lowest sort-order number, so it appears FIRST in the list.
If the visitor fails to make a selection, they cannot proceed to add-to-cart, and an alert message shows, telling them they MUST make a choice in these options, before a product can be added to the cart.
EG:
Option NAME = "Shirt Colour"
Option VALUES for "Shirt Colour" :-
(Sort order 1) Please make a selection... (Display Only and Default option)
(Sort order 2) Red
(Sort order 3) Green
(Sort order 4) Blue
20 years a Zencart User
I understand checkboxes are for multiple choices and I'm not wanting to force a single choice from among the checkboxes. I just wanted to force at least one choice so the cart isn't 0.00 when someone clicks add to cart and they haven't made any selection. Thanks schoolboy.
Last edited by buildingblocks; 28 Oct 2011 at 01:09 PM.