Cameron Posted June 19, 2015 Report Share Posted June 19, 2015 Hi everyone! I have a multi-select Listbox on my Search page. The Listbox is very large, but sometimes users want to select all options. And deselct too. Is it possible to create Select All and Deselect all buttons on a Search Page? Thank you for your time! Quote Link to comment Share on other sites More sharing options...
0 Jan Posted June 19, 2015 Report Share Posted June 19, 2015 Hi Cameron, You can add an HTML Block, click the "Source" button and enter the following code (the code can be used as it is, if the Listbox is the first field on the Search page. You can find the instructions how to define the id of a field in the article): <script type="text/javascript"> function selectAllOptions() { var ref = document.getElementById("Value1_1"); for(i=0; i<ref.options.length; i++) ref.options[i].selected = true; } function DeselectAllOptions() { var ref = document.getElementById("Value1_1"); for(i=0; i<ref.options.length; i++) ref.options[i].selected = false; } </script> <input type="button" value="Select All" onclick="selectAllOptions();" /> <input type="button" value="Deselect All" onclick="DeselectAllOptions();" /> I hope, it helps. Quote Link to comment Share on other sites More sharing options...
1 GoodBoy Posted November 20, 2021 Report Share Posted November 20, 2021 Hello! Just want to share this another solution in deselecting all the selected options. eunha 1 Quote Link to comment Share on other sites More sharing options...
0 Cameron Posted June 19, 2015 Author Report Share Posted June 19, 2015 Hi Jan, Thank you for your answer! Yes, it works. Styles are not applied, but I will find how to fix it myself. Thank you for your time! Quote Link to comment Share on other sites More sharing options...
0 GoodBoy Posted August 7, 2022 Report Share Posted August 7, 2022 Hi! Refer to this post if you want to select multiple options without having to hold the CTRL button on your keyboard. Quote Link to comment Share on other sites More sharing options...
Question
Cameron
Hi everyone!
I have a multi-select Listbox on my Search page.
The Listbox is very large, but sometimes users want to select all options. And deselct too.
Is it possible to create Select All and Deselect all buttons on a Search Page?
Thank you for your time!
Link to comment
Share on other sites
4 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.