Carioca Posted September 27, 2019 Report Share Posted September 27, 2019 In my search form in Reports DataPage, I want to select all the items in a multi-select listbox when my checkbox is checked. Also, when it is unchecked, all the items should be deselected. Any ideas? Quote Link to comment Share on other sites More sharing options...
AtayBalunbalunan Posted September 27, 2019 Report Share Posted September 27, 2019 You can use the code below as a reference. <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { var c_checkbox = document.getElementById("selectAll") ; var elementID = event.detail.uniqueSuffix; function c_event () { if (c_checkbox.checked) { var listBox = document.getElementById('Value1_1' + elementID); for (i = 0; i < listBox.options.length; i++) listBox.options[i].selected = true; } else { var listBox = document.getElementById('Value1_1' + elementID); for (i = 0; i < listBox.options.length; i++) listBox.options[i].selected = false; } } c_checkbox.onclick = c_event; }); </script> Add this in your search's footer with the HTML editor being disabled. Just make the necessary changes for your form elements' ID attribute. You may use this guide for that. Watusi and Carioca 1 1 Quote Link to comment Share on other sites More sharing options...
Vitalikssssss Posted September 27, 2019 Report Share Posted September 27, 2019 Hi @Carioca, BTW there is a setting in Datapage wizard available for this. Regards, vitalikssssss Quote Link to comment Share on other sites More sharing options...
Carioca Posted October 4, 2019 Author Report Share Posted October 4, 2019 Hi Vitalikssssss, I'm not using a List data type for the field but Text (255) instead. But thank you for sharing that info. Quote Link to comment Share on other sites More sharing options...
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.