Splunk Dev

Drop Down based on radio button selection

bharathkumarnec
Contributor
<form>
  <label>Dates test</label>
  <fieldset submitButton="false">
  <input type="radio" token="selection">
<label> Select a value</label>
<choice value="Quarter">Quarter</choice>
<choice value="Month">Month</choice>
<choice value="Week">Week</choice>
<default>Month</default>

<change>
<condition value="Month">
  <set token="show_category1">true</set>
            </condition>
            <condition>
              <unset token="show_category"></unset>
            </condition>
            </change>
            <change>
            <condition value="Quarter">
  <set token="show_category">true</set>
            </condition>
            <condition>
              <unset token="show_category1"></unset>
            </condition>


</change>

</input>
<input type="dropdown" token="Quarter" depends="$show_category$">
  <label> Select </label>
<choice value="Q1">Q1</choice>
<choice value="Q2">Q2</choice>
<choice value="Q3">Q3</choice>
<choice value="Q4">Q4</choice>
<default>Q1</default>
</input>
<input type="dropdown" token="Month" depends="$show_category1$">
<label> Select $Month$</label>
<choice value="Q1">Jan</choice>
<choice value="Q2">Feb</choice>
<choice value="Q3">Mar</choice>
<choice value="Q4">Apr</choice>
<default>Jan</default>
</input>
</fieldset>

</form>

Drop down need to be shown based on the radio button selection, button it is not working out to me...kindly help me out where i am wrong?

Regards,
BK

Tags (1)
0 Karma
1 Solution

elliotproebstel
Champion

I believe the issue is that you have two <change> items in a row, and within them, you have too many <condition> tags. Try replacing the whole <change>...</change> section above with this:

<change>
 <condition value="Month">
  <set token="show_category1">true</set>
  <unset token="show_category"></unset>
 </condition>
 <condition value="Quarter">
  <set token="show_category">true</set>
  <unset token="show_category1"></unset>
 </condition>
</change>

View solution in original post

elliotproebstel
Champion

I believe the issue is that you have two <change> items in a row, and within them, you have too many <condition> tags. Try replacing the whole <change>...</change> section above with this:

<change>
 <condition value="Month">
  <set token="show_category1">true</set>
  <unset token="show_category"></unset>
 </condition>
 <condition value="Quarter">
  <set token="show_category">true</set>
  <unset token="show_category1"></unset>
 </condition>
</change>

bharathkumarnec
Contributor

Thanks for correcting! It worked!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...