Jess147 Posted January 31, 2019 Report Share Posted January 31, 2019 Is there a way to limit the number to be selected on a multi-select listbox? Quote Link to comment Share on other sites More sharing options...
0 AtayBalunbalunan Posted January 31, 2019 Report Share Posted January 31, 2019 Hi Jess147, I think this is not yet possible using Caspio Bridge's standard feature but you may suggest this in their Ideabox at http://ideabox.caspio.com and you may also try custom coding, JavaScript - if you are familiar with it, to be able to achieve this. Here is a JS guide to Caspio's form elements: Quote Link to comment Share on other sites More sharing options...
0 Jess147 Posted February 1, 2019 Author Report Share Posted February 1, 2019 Thank you! I'll try to do JavaScript Quote Link to comment Share on other sites More sharing options...
0 DefinitelyNot31337 Posted August 13, 2019 Report Share Posted August 13, 2019 Hello @Jess147, The way Caspio setup their custom element for List-Strings seems more complicated that it looks. You may try adding this poorly-written code to your footer to limit the selections on your Submission Form. Currently, it only works on Multi-Select Listbox. I'll try to get back to this thread another time so we can implement a better solution and add support to Multi-Select Dropdown, as well as other types of DataPages. Cheers! DN31337 <script> setTimeout(function() { var fieldName = 'ls'; //replace with your actual field name var cbs = document.querySelectorAll(`[id*=InsertRecord${fieldName}] .Item`) cbs.forEach(function(elem) { elem.addEventListener('click', function(e) { setTimeout(function() { var counter = document.querySelectorAll(`[id*=InsertRecord${fieldName}] .Item [type=checkbox]:checked`).length; console.log(e.target, counter) if(counter > 2) { //replace with the limit you wish e.target.click(); } }, 333); }); }); console.log('deChecker ready!'); }, 1500) </script> Glitch 1 Quote Link to comment Share on other sites More sharing options...
Question
Jess147
Is there a way to limit the number to be selected on a multi-select listbox?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.