Dashboards & Visualizations

How to reset checkbox values?

vdevarayan
Path Finder

I am using Splunk 6.2.1

I have a checkbox inside a panel

        <panel>
          <input type="checkbox" token="cbstring" searchWhenChanged="true">
            <label></label>
            <choice value="max">Max</choice>
            <choice value="min">Min</choice>
          </input>
    ...
       </panel>    

The problem is that once a checkbox is selected, the searchstring gets populated.
Unchecking does NOT reset the values.
In other words, if i select a checkbox, search works correctly. But, when the same checkbox is un-checked, the token cbstring does not get re-populated - instead the old values persists.

How to reset the token associated with the checkbox?

Tags (2)
0 Karma

jeffland
SplunkTrust
SplunkTrust

Hm. It looks like you want a radio button, not two checkboxes. Or are the two supposed to be selected at the same time?

Otherwise, to start an action on uncheck of a checkbox, you can listen to click on it and call your search based on the condition that !$(this).is(':checked'). But I wonder how your search looks like if the user selects neither min nor max - if it uses count, you should add that as the third option (and, as I said, use radio buttons).

0 Karma

vdevarayan
Path Finder

I have many other options - and i want checkbox - meaning more than one option can be selected.
I am having trouble with resetting the token - the old values persist.

0 Karma

jeffland
SplunkTrust
SplunkTrust

That's strange. Are you only using a search manager, or also a post process manager as well? I just tried, and in its simplest form unchecking a checkbox immediately triggers an update to the search that uses the token. How are you using your token in the search?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...