<?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 limit number of input values in Text Box input in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520498#M35009</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/86891"&gt;@mbasharat&lt;/a&gt;&amp;nbsp;what do you mean by limiting the number of values? Are values some type of delimited strings? Or are they based on length?&lt;/P&gt;</description>
    <pubDate>Sun, 20 Sep 2020 17:45:23 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2020-09-20T17:45:23Z</dc:date>
    <item>
      <title>How to limit number of input values in Text Box input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520368#M34985</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have text box input that I have tweaked for taking multiple values and it works fine. I need to limit number of values that a user can&amp;nbsp;insert. How to do this?&lt;/P&gt;&lt;P&gt;Thanks in-advance!!!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 18:21:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520368#M34985</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-09-18T18:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of input values in Text Box input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520465#M35001</link>
      <description>&lt;P&gt;you can add simple js to your simple xml.&lt;/P&gt;&lt;P&gt;The below JS has two options, either you can limit characters based on input id or all inputs is commented.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Only input which has id "user_text_input" in simple xml will be limited to 9 characters.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require(['jquery','splunkjs/mvc','splunkjs/mvc/simplexml/ready!'], function(){
   //Below is based on input ID
   $('#user_text_input').find(':input').attr("maxlength", 9); 
   //Below is for all inputs
   //$('input').attr("maxlength", 9); 
});
&lt;/LI-CODE&gt;&lt;P&gt;simple.xml&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form script="limittextboxchars.js"&amp;gt;
  &amp;lt;label&amp;gt;Limit - texbox characters&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="text" id="user_text_input" token="field1"&amp;gt;
      &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="text" token="field2"&amp;gt;
      &amp;lt;label&amp;gt;field2&amp;lt;/label&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Sep 2020 07:27:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520465#M35001</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-20T07:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of input values in Text Box input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520498#M35009</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/86891"&gt;@mbasharat&lt;/a&gt;&amp;nbsp;what do you mean by limiting the number of values? Are values some type of delimited strings? Or are they based on length?&lt;/P&gt;</description>
      <pubDate>Sun, 20 Sep 2020 17:45:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520498#M35009</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-20T17:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of input values in Text Box input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520507#M35012</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is a text box input on one of my dashboards where user can insert more than on Vulnerability IDs separated/delimited by comma. At the moment, they can insert as many as they want but we need to have this input limited e.g. no more than 10 Vulnerability IDs.&lt;/P&gt;&lt;P&gt;Vulnerability ID is in below format and it is standard:&lt;/P&gt;&lt;P&gt;ABC-2020-1234&lt;/P&gt;&lt;P&gt;When user inputs more than one, it looks like this:&lt;/P&gt;&lt;P&gt;ABC-2020-1234,DEF-2020-1234,GHI-2020-1234 and so on.&lt;/P&gt;&lt;P&gt;If I understand it will need to be character limit to be placed. For example, above three total 41 characters including comma delimiter.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Custom CSS/JS etc. are not the options available or what I am looking for. If an XML code can be done in dashboard, that will be great and lesser maintenance.&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; &lt;/U&gt;I am posted another question referencing one of your solutions in the past for another issue below so if you ca look at this one and guide as well, that will be great. Thanks!!!&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/Increasing-size-of-textbox-input/m-p/520404#M34993" target="_blank" rel="noopener"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/Increasing-size-of-textbox-input/m-p/520404#M34993&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Sep 2020 19:27:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520507#M35012</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-09-20T19:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of input values in Text Box input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520508#M35013</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@ thambisetty,&lt;/P&gt;&lt;P&gt;Please see my response with additional details to &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/201110"&gt;@niketn&lt;/a&gt;&amp;nbsp;Thanks in-advance!!!&lt;/P&gt;</description>
      <pubDate>Sun, 20 Sep 2020 19:29:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520508#M35013</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-09-20T19:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of input values in Text Box input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520511#M35015</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/86891"&gt;@mbasharat&lt;/a&gt;&amp;nbsp;So you want to restrict only 10 Vulnerability IDs which are comma delimited. Please refer to one of my previous answers of validating only 5 URLs using an independent search to perform complex validations. The solution is purely Simple XML however, you need to change the validation to pattern match for vulnerability and up to 10 comma separated values instead of 5.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-text-box-using-condition/td-p/509589" target="_blank"&gt;https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-text-box-using-condition/td-p/509589&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;This should be straightforward conversion, if not let me know!&lt;/P&gt;</description>
      <pubDate>Sun, 20 Sep 2020 19:35:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520511#M35015</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-20T19:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of input values in Text Box input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520538#M35020</link>
      <description>&lt;P&gt;Hi @ niketnilay,&lt;/P&gt;&lt;P&gt;I have tweaked and consolidated your provided solution code based on my need and it works perfect to produce validation errors to users.&lt;/P&gt;&lt;P&gt;However, there is one big issue. I am using &lt;STRONG&gt;| search vuln_id IN ($vulnid$)&lt;/STRONG&gt; in my search. If a user inserts 11 values instead of limit of 10 in validation check in your solution, validation errors are produced as coded but search still runs for 11 values instead of 10. How to make the search fail unless user inserts 10 values or less?&lt;/P&gt;&lt;P&gt;Thanks and awaiting response.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 03:06:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520538#M35020</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-09-21T03:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of input values in Text Box input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520541#M35022</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/86891"&gt;@mbasharat&lt;/a&gt;&amp;nbsp;I think the idea is to ensure that original token is not used as is in the final search.&lt;/P&gt;&lt;P&gt;For example&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Set token from text box to &lt;STRONG&gt;$tok_input_text$&lt;/STRONG&gt; and then perform validation.&lt;/LI&gt;&lt;LI&gt;After the validation passes set the token &lt;STRONG&gt;$tok_validated_text$&lt;/STRONG&gt; which should be used by the searches.&lt;/LI&gt;&lt;LI&gt;This final token should not be set if validation fails.&lt;/LI&gt;&lt;LI&gt;This should also be unset each time text box input value changes.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;I am sure I would have taken care of above steps in the previous example as well. However, if it is not clear refer to a very basic 9 digit validation answer which should explain these steps better:&amp;nbsp;&lt;A href="https://community.splunk.com/t5/Developing-for-Splunk-Enterprise/Textbox-Character-limitation/m-p/520505#M4503" target="_blank"&gt;https://community.splunk.com/t5/Developing-for-Splunk-Enterprise/Textbox-Character-limitation/m-p/520505#M4503&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Do up vote the original answers as well if they help!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 04:08:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520541#M35022</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-21T04:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit number of input values in Text Box input</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520545#M35026</link>
      <description>&lt;P&gt;Great. This worked!!! THANK YOU &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Sep 2020 04:37:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-limit-number-of-input-values-in-Text-Box-input/m-p/520545#M35026</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-09-21T04:37:19Z</dc:date>
    </item>
  </channel>
</rss>

