<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to display text boxes upon clicking button in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-text-boxes-upon-clicking-button/m-p/703382#M57656</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just wanted to know if there is any way to display text boxes upon clicking any of the buttons in my dashboard. I uploaded pic for your reference.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Upon clicking any of the button, i want to display 2 text boxes. And later i would like to provide input in those text boxes and search for the logs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;dashboard version="1.1" script="customview.js" theme="dark"&amp;gt;
    &amp;lt;label&amp;gt;Search Dashboard&amp;lt;/label&amp;gt;
    &amp;lt;row&amp;gt;
        &amp;lt;panel&amp;gt;
            &amp;lt;html&amp;gt;
                &amp;lt;h1 style="text-align: center;"&amp;gt;Choose from the below options to get started :)&amp;lt;/h1&amp;gt;

                &amp;lt;!-- Centered button container --&amp;gt;
                &amp;lt;div style="display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 20px;"&amp;gt;
                    &amp;lt;button id="proxySearch" onclick="showTextBoxes()" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;"&amp;gt;Proxy Search&amp;lt;/button&amp;gt;
                    &amp;lt;button id="WAFsearch" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;"&amp;gt;WAF Search&amp;lt;/button&amp;gt;
                    &amp;lt;button id="DNSsearch" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;"&amp;gt;DNS Search&amp;lt;/button&amp;gt;
                    &amp;lt;button id="Emailsearch" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;"&amp;gt;Email Search&amp;lt;/button&amp;gt;
                &amp;lt;/div&amp;gt;
                &amp;lt;div id="mychart"&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;/html&amp;gt;
        &amp;lt;/panel&amp;gt;
    &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I first wanted to know how to show text boxes upon clicking any of the button. I know we have to use js for this kind of activity, but can anyone suggest how it needs to be done?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DarkSky_18_0-1730551490330.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/33330i9F0738E247262E41/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DarkSky_18_0-1730551490330.png" alt="DarkSky_18_0-1730551490330.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;DarkSky_18_0-1730551490330.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 02 Nov 2024 12:47:31 GMT</pubDate>
    <dc:creator>DarkSky_18</dc:creator>
    <dc:date>2024-11-02T12:47:31Z</dc:date>
    <item>
      <title>How to display text boxes upon clicking button</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-text-boxes-upon-clicking-button/m-p/703382#M57656</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just wanted to know if there is any way to display text boxes upon clicking any of the buttons in my dashboard. I uploaded pic for your reference.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Upon clicking any of the button, i want to display 2 text boxes. And later i would like to provide input in those text boxes and search for the logs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;dashboard version="1.1" script="customview.js" theme="dark"&amp;gt;
    &amp;lt;label&amp;gt;Search Dashboard&amp;lt;/label&amp;gt;
    &amp;lt;row&amp;gt;
        &amp;lt;panel&amp;gt;
            &amp;lt;html&amp;gt;
                &amp;lt;h1 style="text-align: center;"&amp;gt;Choose from the below options to get started :)&amp;lt;/h1&amp;gt;

                &amp;lt;!-- Centered button container --&amp;gt;
                &amp;lt;div style="display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 20px;"&amp;gt;
                    &amp;lt;button id="proxySearch" onclick="showTextBoxes()" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;"&amp;gt;Proxy Search&amp;lt;/button&amp;gt;
                    &amp;lt;button id="WAFsearch" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;"&amp;gt;WAF Search&amp;lt;/button&amp;gt;
                    &amp;lt;button id="DNSsearch" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;"&amp;gt;DNS Search&amp;lt;/button&amp;gt;
                    &amp;lt;button id="Emailsearch" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;"&amp;gt;Email Search&amp;lt;/button&amp;gt;
                &amp;lt;/div&amp;gt;
                &amp;lt;div id="mychart"&amp;gt;&amp;lt;/div&amp;gt;
            &amp;lt;/html&amp;gt;
        &amp;lt;/panel&amp;gt;
    &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I first wanted to know how to show text boxes upon clicking any of the button. I know we have to use js for this kind of activity, but can anyone suggest how it needs to be done?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DarkSky_18_0-1730551490330.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/33330i9F0738E247262E41/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DarkSky_18_0-1730551490330.png" alt="DarkSky_18_0-1730551490330.png" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;DarkSky_18_0-1730551490330.png&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Nov 2024 12:47:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-text-boxes-upon-clicking-button/m-p/703382#M57656</guid>
      <dc:creator>DarkSky_18</dc:creator>
      <dc:date>2024-11-02T12:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to display text boxes upon clicking button</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-text-boxes-upon-clicking-button/m-p/703849#M57679</link>
      <description>&lt;P&gt;Ok I had fun with this one.&amp;nbsp; I've never embedded JavaScript before so this was brand new for me.&amp;nbsp; I will tell you that if you change the js code you likely need to restart Splunk and I had to add a reset all button cause I did find some odd token behavior if you edit the xml on the fly.&lt;BR /&gt;&lt;U&gt;&lt;STRONG&gt;JavaScript&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;require([
    "splunkjs/mvc",
    "splunkjs/mvc/simplexml/ready!"
], function(mvc) {

    // Get your div
    var var_proxysearch = $("#btn_proxysearch");
    var var_wafsearch = $("#btn_wafsearch");
    var var_dnssearch = $("#btn_dnssearch");
    var var_emailsearch = $("#btn_emailsearch");
    var var_resetall = $("#btn_resetall");

    // lets play hide and seek
    var_proxysearch.on("click", function(f_proxysearch) {
        var tokens = mvc.Components.get("submitted");
        tokens.set("tok_proxysearch","TRUE");
        tokens.unset("tok_wafsearch");
        tokens.unset("tok_dnssearch");
        tokens.unset("tok_emailsearch");
    });

    var_wafsearch.on("click", function(f_wafsearch) {
        var tokens = mvc.Components.get("submitted");
        tokens.unset("tok_proxysearch");
        tokens.set("tok_wafsearch","TRUE");
        tokens.unset("tok_dnssearch");
        tokens.unset("tok_emailsearch");
    });

    var_dnssearch.on("click", function(f_dnssearch) {
        var tokens = mvc.Components.get("submitted");
        tokens.unset("tok_proxysearch");
        tokens.unset("tok_wafsearch");
        tokens.set("tok_dnssearch","TRUE");
        tokens.unset("tok_emailsearch");
    });

    var_emailsearch.on("click", function(f_emailsearch) {
        var tokens = mvc.Components.get("submitted");
        tokens.unset("tok_proxysearch");
        tokens.unset("tok_wafsearch");
        tokens.unset("tok_dnssearch");
        tokens.set("tok_emailsearch","TRUE");
    });

    var_resetall.on("click", function(f_resetall) {
        var tokens = mvc.Components.get("submitted");
        tokens.unset("tok_proxysearch");
        tokens.unset("tok_wafsearch");
        tokens.unset("tok_dnssearch");
        tokens.unset("tok_emailsearch");
    });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the &lt;U&gt;&lt;STRONG&gt;XML&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form script="btn_hide_n_seek.js" version="1.1" theme="dark"&amp;gt;
  &amp;lt;label&amp;gt;Answers - Classic - Hide and Seek&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="text" token="tok_field1" depends="$tok_proxysearch$"&amp;gt;
      &amp;lt;label&amp;gt;Proxy&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="tok_field2" depends="$tok_wafsearch$"&amp;gt;
      &amp;lt;label&amp;gt;WAF&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="tok_field3" depends="$tok_dnssearch$"&amp;gt;
      &amp;lt;label&amp;gt;DNS&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="tok_field4" depends="$tok_emailsearch$"&amp;gt;
      &amp;lt;label&amp;gt;Email&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;h1 style="text-align: center;"&amp;gt;Choose from the below options to get started :)&amp;lt;/h1&amp;gt;
        &amp;lt;!-- Centered button container --&amp;gt;
        &amp;lt;div style="display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 20px;"&amp;gt;
            &amp;lt;button class="btn btn-primary" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;" id="btn_proxysearch"&amp;gt;Proxy Search&amp;lt;/button&amp;gt;
            &amp;lt;button class="btn btn-primary" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;" id="btn_wafsearch"&amp;gt;WAF Search&amp;lt;/button&amp;gt;
            &amp;lt;button class="btn btn-primary" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;" id="btn_dnssearch"&amp;gt;DNS Search&amp;lt;/button&amp;gt;
            &amp;lt;button class="btn btn-primary" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;" id="btn_emailsearch"&amp;gt;Email Search&amp;lt;/button&amp;gt;
            &amp;lt;button class="btn btn-primary" style="background-color: #007bff; color: white; width: 150px; height: 50px; font-size: 18px; border: none; border-radius: 5px;" id="btn_resetall"&amp;gt;Reset All&amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row id="rows_proxy" depends="$tok_proxysearch$"&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;h1 style="text-align: center;"&amp;gt;Proxy Row(s)&amp;lt;/h1&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row id="rows_waf" depends="$tok_wafsearch$"&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;h1 style="text-align: center;"&amp;gt;WAF Row(s)&amp;lt;/h1&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row id="rows_dns" depends="$tok_dnssearch$"&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;h1 style="text-align: center;"&amp;gt;DNS Row(s)&amp;lt;/h1&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row id="rows_email" depends="$tok_emailsearch$"&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;h1 style="text-align: center;"&amp;gt;Email Search&amp;lt;/h1&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 19:53:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-text-boxes-upon-clicking-button/m-p/703849#M57679</guid>
      <dc:creator>dural_yyz</dc:creator>
      <dc:date>2024-11-07T19:53:23Z</dc:date>
    </item>
  </channel>
</rss>

