Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2008
    Posts
    91
    Plugin Contributions
    0

    Default How to force selection of a checkbox?

    I know the "trick" for forcing selection of one of several radio buttons (make an additional one named "please select", mark it display only, and make it the default as explained here: http://www.zen-cart.com/forum/showthread.php?t=95520)

    However, this same thing does not work for checkboxes, not in the same way.

    I want to have 5 checkboxes for the user to indicate which of several models of a product they may own. They can specify more than 1, but they must at least pick 1.

    So if I try the "trick" method above, it will not force the user to pick one; the product will be added to the cart, and then the cart will say that invalid options have been selected and you need to go back and fix them. It doesn't tell you what is wrong specifically. This is much worse than what happens with the radio buttons or drop downs, where it will not allow you to add the product to the cart and it tells you exactly which option needs to be selected.

    I suspect that this will not work due to the nature of checkboxes, and if so, any hints on where to modify the code to fix this would be helpful.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,669
    Plugin Contributions
    6

    Default Re: How to force selection of a checkbox?

    At this time, there isn't a way to force a selection on the checkboxes ...

    This is something we are looking into for a future release ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3
    Join Date
    Apr 2008
    Posts
    91
    Plugin Contributions
    0

    Default Re: How to force selection of a checkbox?

    I had a feeling you were going to say that. ;)

    I hope when you are working on this, you all will consider a redesign of the way this whole issue works, with regards to any type of option selection. The rigamarole that people have to go through to get this to work on radio buttons and drop downs is very klugey (as discussed in the thread referenced above.)

    By way of example, I am moving to using ZC from having used MIVA for a store for many years. The way they do it is quite elegant and you should use it as some sort of a model.

    Basically, there is a setting for an attribute named "required". If you check "required", then the user is forced to make a selection, regardless of what type of UI object it is. You can specify one of the options to be the default, and in that case, the default is pre-selected unless the user chooses something else. But ticking the "required" setting on the attribute controls the whole behavior - no need to make extra option values and try to hide them (as discussed in the thread referenced above.)

    In your case, it seems this would be a setting in the Option Names section. You simply tick the "required" checkbox on the option name, and it then will not allow the user to add the item to the cart without making a selection of one of the option values (or one or more, in the case of a group of checkboxes in the same attribute.)

    Thanks!

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,669
    Plugin Contributions
    6

    Default Re: How to force selection of a checkbox?

    Thanks for the suggestion ...

    We know that this is lacking in the attributes and do plan to address it in a future release as, quite frankly, the dang thing drives us nuts as well ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

 

 

Similar Threads

  1. CheckBox Maximum Selection
    By phoenix80 in forum Setting Up Categories, Products, Attributes
    Replies: 9
    Last Post: 16 May 2011, 09:33 AM
  2. Force Selection of Attributes? & a way to position them better?
    By brian02138 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 17 Jan 2008, 07:10 PM
  3. Force All CAPS
    By ranpan in forum General Questions
    Replies: 1
    Last Post: 20 Jul 2006, 03:32 PM
  4. force a currency
    By rikdc in forum Managing Customers and Orders
    Replies: 2
    Last Post: 10 May 2006, 03:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •