Quantcast
Channel: Questions in topic: "splunk-enterprise"
Viewing all articles
Browse latest Browse all 47296

How can I apply JavaScript on a multiselect dropdown menu?

$
0
0
We have a multiselect dropdown with options "All, A , b, c , D" Requirement: Whenever user selects "All" , then user cannot select any other option. If user selects anything else , then he can select multiple things. My logic : Create a JavaScript which reads the value selected by the user and then if "All" is selected , then convert multiselect drop down to a normal dropdown . If anything else is selected , then let it be a multiselect dropdown . Things I have tried: 1) Fetching value from dropdown to JavaScript using "splunkjs/mvc/textinputview" (var token_def = defaultTokenModel.get("token_name");) 2) If token_def = "all" , then render the view to normal dropdown . Else it remains to be multiselect dropdown. Second thing I want to try is by using global flag. Setting it to value 1 when "All" is selected and "0" for others , then passing it to HTML. Please advise. Please provide me doc related to JavaScript if available since I am new in this. Thanks in Advance!!!

Viewing all articles
Browse latest Browse all 47296

Trending Articles