Forum Discussion
Limiting the number of selections a user can make on custom buttons
Hello, I need some help.
I am trying to limit the number of selections a user can make on the custom buttons in my project. There are eight buttons on each page. I want to limit the user to choose only five buttons and no more. Is there a way to allow them to select up to 5 choices and stop them from selecting more with a popup or something? I have attached the .story file as well.
Any help would be appreciated! Thank you.
- WaltHamiltonSuper Hero
The attached sample will do what you are asking. I made the changes only to slide 1.2.
But if I could barge in with some unsolicited advice, I would make one serious change. Showing more detail and giving credit for making a selection really needs to be a more deliberate action. As it is, if the learner comes to this slide with their cursor at the top of the page, and wants to select an option at the bottom of the list, it is quite likely they will move the cursor across the whole list, and inadvertently make four selections, instead of the one they intended. I would strongly suggest showing the layer when the learner clicks, then on the layer, having a clickable object to hide the layer.
Either way, the attached version allows only five hovers, prevents multiple hovers on one object, and changes the state of the objects when once hovered over. If you change the triggers that show the layers from hover to click, it will still work the same.
- KaylaMcGill-eaaCommunity Member
Hi Walt,
Thank you for taking the time to do this! Also, I see what you mean about the hovering situation with the layers, and I agree with your suggestion. I just changed the layers to be clickable, which fixed the problem. Thank you so much for your help!
- MichaelGallagheCommunity Member
See attached screen 1.2.
I created a number variable that has 1 added every time a button is selected. When the variable adds up to 5, a transparent filled box that is set to initial state Hidden gets set to normal. That box has a trigger to show a layer that I created called "Button Prompt" which tells the user that they have made 5 selections.
- KaylaMcGill-eaaCommunity Member
Hi Michael,
Thank you so much! I love the popup that shows up after selecting 5 choices. Out of curiosity, is there a way for it to recognize when the user de-selects an option? I tried clicking 5 and de-selecting 2 but it wouldn't allow me to de-select anything after 5 clicks.
- WaltHamiltonSuper Hero
Kayla,
Knowing you aren't married to using the hover makes it a lot easier to prevent more than five clicks. On the other hand, allowing deselection both before and after five are chosen is a bit trickier.
Try this.