16
Views
3
Comments
Dynamic placeholder on dropdown selection
Question
Application Type
Mobile

I want to create dynamic placeholder.

When I select area in dropdown as in image 2 . I want to change the placeholder to search by area.

mvp_badge
MVP
Rank: #78

Hi Nilesh,

As a solution for the mentioned use-case, follow the below steps:

Implementation Steps:

1) Define a Dropdown On Change handler action flow i.e. On Change screen action for the First dropdown

2) Add a JS node with two input parameter within the Dropdown widget On Change action flow as shown below

Note

SearchCategory  variable is the same which is mapped to the Dropdown Variable property i.e. It holds the dropdown selection value

Input_Search.Id is the runtime Id property of the search input control

3) Update the search Input control's placeholder property value with the Selected Dropdown value using the below JS script

var searchInput = document.querySelector('#' + $parameters.SearchInputEle);

searchInput.placeholder = "Search By " + $parameters.SearchCategory;

See this sample app


Hope this helps you!


Kind regards,

Benjith Sam