[Reactive Web] How to change the search prompt of dropdown tags dynamically?

Hi,

I have the following dropdown with "All" as search prompt. 

I need to change the search prompt when the dropdown has values selected, like the following:

This should happen dynamically. I tried with an if condition on the search prompt but it doesn't work. Is there any way to accomplish that?

mvp_badge
MVP
Solution

Hi Bruno,


You can change that very easily with JavaScript.

Whenever a value is changed, a handler will be triggered and you can run a JavaScript widget to set the new prompt value (placeholder element). Something like this:


The snippet below:

var element = document.querySelector(".search--wrapper .choices__input");
element.setAttribute("placeholder", $parameters.NewValue);


Kind Regards,
João

It worked!

Thank you, João

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.