<?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 Re: how to create a textbox with numeric value in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472408#M45758</link>
    <description>&lt;P&gt;I hope the above code matches your requirement.&lt;/P&gt;</description>
    <pubDate>Tue, 24 Dec 2019 06:32:32 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2019-12-24T06:32:32Z</dc:date>
    <item>
      <title>how to create a textbox with numeric value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472402#M45752</link>
      <description>&lt;P&gt;I have created a textbox input type in a dashboard.&lt;/P&gt;

&lt;P&gt;I want to limit that user can enter only numeric value in a textbox.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 05:52:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472402#M45752</guid>
      <dc:creator>vivek_manoj</dc:creator>
      <dc:date>2019-12-24T05:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a textbox with numeric value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472403#M45753</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Check this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;textbox&amp;lt;/label&amp;gt;
     &amp;lt;fieldset submitButton="false"&amp;gt;
     &amp;lt;input type="text" token="number"&amp;gt;
       &amp;lt;label&amp;gt;Add threshold&amp;lt;/label&amp;gt;
       &amp;lt;change&amp;gt;
         &amp;lt;condition match="match(value, &amp;amp;quot;^[0-9]+$&amp;amp;quot;)"&amp;gt;&amp;gt;
           &amp;lt;set token="form.number"&amp;gt;$value$&amp;lt;/set&amp;gt;
         &amp;lt;/condition&amp;gt;
         &amp;lt;condition&amp;gt;
           &amp;lt;unset token="form.number"&amp;gt;&amp;lt;/unset&amp;gt;
         &amp;lt;/condition&amp;gt;
       &amp;lt;/change&amp;gt;
     &amp;lt;/input&amp;gt;
   &amp;lt;/fieldset&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Dec 2019 06:00:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472403#M45753</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-12-24T06:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a textbox with numeric value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472404#M45754</link>
      <description>&lt;P&gt;Hi Ravi,&lt;/P&gt;

&lt;P&gt;I have tried your above code, but I was looking that it wouldn't allow to enter the non-numberic data at all in the text box.&lt;/P&gt;

&lt;P&gt;I can see its allowing to enter non-numberic data as well as not to pass the value in the url.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 06:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472404#M45754</guid>
      <dc:creator>vivek_manoj</dc:creator>
      <dc:date>2019-12-24T06:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a textbox with numeric value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472405#M45755</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try the below code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="test.js"&amp;gt;
  &amp;lt;label&amp;gt;textbox&amp;lt;/label&amp;gt;
     &amp;lt;fieldset submitButton="false"&amp;gt;
     &amp;lt;input type="text" token="number" id="digits"&amp;gt;
       &amp;lt;label&amp;gt;Add threshold&amp;lt;/label&amp;gt;
     &amp;lt;/input&amp;gt;
   &amp;lt;/fieldset&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Javascript: test.js&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require(["jquery",
"splunkjs/mvc",
"splunkjs/mvc/simplexml/ready!"], 
function($,mvc) {

    $("#digits [data-test='textbox']").keyup(function () { 
        this.value = this.value.replace(/[^0-9\.]/g,'');
    });
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Dec 2019 06:18:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472405#M45755</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-12-24T06:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a textbox with numeric value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472406#M45756</link>
      <description>&lt;P&gt;@vivek_manoj &lt;/P&gt;

&lt;P&gt;I suggest you to go with HTML tag. Check below XML.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;TextBox&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;input type="number" /&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Dec 2019 06:21:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472406#M45756</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-12-24T06:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a textbox with numeric value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472407#M45757</link>
      <description>&lt;P&gt;Hi Kamlesh,&lt;/P&gt;

&lt;P&gt;Thanks for replying but in that case, how can we pass the value from the box to the panel.&lt;/P&gt;

&lt;P&gt;As the box is inside html tag.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 06:25:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472407#M45757</guid>
      <dc:creator>vivek_manoj</dc:creator>
      <dc:date>2019-12-24T06:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a textbox with numeric value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472408#M45758</link>
      <description>&lt;P&gt;I hope the above code matches your requirement.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 06:32:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472408#M45758</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-12-24T06:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a textbox with numeric value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472409#M45759</link>
      <description>&lt;P&gt;You have to set textbox value into token value, using javascript,  which you can use in table.  &lt;/P&gt;

&lt;P&gt;You have to trigger set/get token on change/lost focus of the textbox. check below link for javascript reference. Still you need any assistance then let us know. &lt;/P&gt;

&lt;P&gt;&lt;A href="https://dev.splunk.com/enterprise/docs/developapps/webframework/binddatausingtokens/getandsettokenvalues/"&gt;https://dev.splunk.com/enterprise/docs/developapps/webframework/binddatausingtokens/getandsettokenvalues/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=lojUc9v37Jg"&gt;https://www.youtube.com/watch?v=lojUc9v37Jg&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/586958/how-do-i-add-javascript-to-a-splunk-dashboard.html"&gt;https://answers.splunk.com/answers/586958/how-do-i-add-javascript-to-a-splunk-dashboard.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 06:47:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472409#M45759</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-12-24T06:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to create a textbox with numeric value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472410#M45760</link>
      <description>&lt;P&gt;Please confirm.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Dec 2019 09:16:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-to-create-a-textbox-with-numeric-value/m-p/472410#M45760</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-12-24T09:16:02Z</dc:date>
    </item>
  </channel>
</rss>

