I have an option set of colours which are blue, red and green. They are in a drop down and when selected are a search constraint.
There is a blank space above all of the three options and when selected all the colours show up which is what I want. The problem is I would like this blank field to be renamed as “All” so it is clear to the user.
Seeing as you’re using an option set, just create another option called ‘All’, put it at the top of the list and check the box for ‘This input should not be empty’.
Then just use a condition in your workflow action or datasources as required when that option is selected.
When I create another option called ‘All’, and check the box for ‘This input should not be empty’ It displays how I want it too but my search constraint is:
Set state of page index:
Do a search for “colour” with constraint of colour type = dropdown colour value.
When “all” is selected none of my items show up as they are only blue, green or red.
Is there a way to say if “all” is selected do a search for all colours? Is there a way to incorporate this into my original search constraint?
After doing a bit of searching I’ve come across an old post of yours, this looks like the solution! Please can you explain how you got “when this group is focused” ?
When I copy and paste the whole page directly from your link into my editor it works but when I want to implement the dropdown in my own index page it does not work.
This error message pops up on the index page only…
Hi Adam, after some fiddling about I got it working!
I simply gave the dropdown(s) an ID attribute then I just ran some javascript!
// iterate over each dropdown ID
[“1223”, “1224”, “1225”, “1226”].forEach(function(dropdownId) {
// select the dropdown menu element using its ID
var dropdown = document.getElementById(dropdownId);
// get all option elements within the dropdown
var optionElements = dropdown.querySelectorAll(‘option’);
// update the text content of the second option element
if (optionElements.length > 1) {
optionElements[1].textContent = ‘All Options (this replaces the usual blank option)’;
}
});
I used chatbotGPT to edit your original code and it works somehow on mine now.