<?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 increase the textbox size when you want to increase the size of 2 of the 5 text boxes in the dashboard? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/328565#M21307</link>
    <description>&lt;P&gt;There are two options that you can choose from:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Option 1&lt;/STRONG&gt;) Create &lt;CODE&gt;&amp;lt;html&amp;gt;&lt;/CODE&gt; panel with &lt;CODE&gt;text&lt;/CODE&gt; &lt;CODE&gt;input&lt;/CODE&gt; type and set the &lt;CODE&gt;disabled&lt;/CODE&gt; attribute&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;html&amp;gt;
    &amp;lt;input type="text" disabled="disabled" value="$someTextToken$"&amp;gt;&amp;lt;/input&amp;gt;
  &amp;lt;/html&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Option 2&lt;/STRONG&gt;) Use jQuery to set the &lt;CODE&gt;disabled attribute&lt;/CODE&gt; for &lt;CODE&gt;Splunk text input&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Refer to answer below which does this based on logged in user role. However, you just need to always set it to be disabled.&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/575377/can-i-restrict-permissions-for-the-text-box-drilld.html"&gt;https://answers.splunk.com/answers/575377/can-i-restrict-permissions-for-the-text-box-drilld.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Following is the JavaScript code for your scenario to disable Splunk text box input with id &lt;CODE&gt;text5&lt;/CODE&gt; (&lt;CODE&gt;disable_textbox.js&lt;/CODE&gt;).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; require([
      "jquery",
     "splunkjs/mvc/simplexml/ready!"
 ], function($) {
     $(document).ready( function() {
         // Disable TextBox Input with id="text5"
         $(".splunk-textinput [id^='text5']").attr( "disabled", "disabled" );
     });
 });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since this required JavaScript Extension to Simple XML, you would need to save the JavaScript file to your Splunk App's static folder i.e. &lt;CODE&gt;$SPLUNK_HOME/etc/apps/&amp;lt;YourAppName&amp;gt;/appserver/static/disable_textbox.js&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Form root node should point to the JavaScript file &lt;CODE&gt;disable_textbox.js&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form static="disable_textbox.js"&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This also may require Splunk restart/bump/refresh for the changes to take effect and also cleaning browser history may be required.&lt;/P&gt;

&lt;P&gt;Please try one of the approach and confirm.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Mar 2018 18:25:04 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-03-05T18:25:04Z</dc:date>
    <item>
      <title>How to increase the textbox size when you want to increase the size of 2 of the 5 text boxes in the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/328562#M21304</link>
      <description>&lt;P&gt;I have two constraints I cannot use a css file and I only want to increase the size of 2 of the 5 text boxes in the dashboard&lt;BR /&gt;
I want to use simple xml only and it can be inline css&lt;BR /&gt;
it seems to apply to all textboxes&lt;BR /&gt;
I did check all the posts that are available and i cannot do it selectively&lt;/P&gt;</description>
      <pubDate>Sat, 03 Mar 2018 00:12:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/328562#M21304</guid>
      <dc:creator>subhrapan</dc:creator>
      <dc:date>2018-03-03T00:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase the textbox size when you want to increase the size of 2 of the 5 text boxes in the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/328563#M21305</link>
      <description>&lt;P&gt;@subhrapan, following is an sample run anywhere dashboard where &lt;CODE&gt;Text Box Inputs are added to a &amp;lt;panel&amp;gt;&lt;/CODE&gt; (same code should work even if text boxes are not inside a panel, I have just used it for grouping)&lt;/P&gt;

&lt;P&gt;I have added &lt;CODE&gt;id&lt;/CODE&gt; for each text box i.e. &lt;CODE&gt;text1, text2... text5&lt;/CODE&gt; to be used later for CSS Override.&lt;/P&gt;

&lt;P&gt;An &lt;CODE&gt;&amp;lt;html&amp;gt;&lt;/CODE&gt; panel has been created to apply &lt;CODE&gt;CSS &amp;lt;style&amp;gt; override&lt;/CODE&gt; we need. The html panel is always hidden through a token which is never set in the dashboard.&lt;/P&gt;

&lt;P&gt;PS: The default width of text box is &lt;CODE&gt;220px&lt;/CODE&gt;. I have overridden 4th and 5th Text box to be &lt;CODE&gt;300px&lt;/CODE&gt;. I had to add a padding of &lt;CODE&gt;95px&lt;/CODE&gt; before the 5th Text Box to ensure that 4th Text Box is not hidden behind 5th after increasing size by &lt;CODE&gt;80px&lt;/CODE&gt; (plus &lt;CODE&gt;15px&lt;/CODE&gt; normal padding that Splunk adds between elements). &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4498i6D0A2DB44733DBD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Following is the run anywhere Simple XML. There is no dependency with external CSS as the same is added through &lt;CODE&gt;&amp;lt;html&amp;gt;&lt;/CODE&gt; panel with &lt;CODE&gt;&amp;lt;style&amp;gt;&lt;/CODE&gt; section as stated earlier. Please try out and confirm.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Text Box Size&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel depends="$alwaysHideCSSStyle$"&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;style&amp;gt;
          #text4 .splunk-textinput
          {
            width: 300px !important;
          }
          #text4 .splunk-textinput input{
            width: 300px !important;
          }           
          #text5
          {
            padding-left:95px !important;
          }
          #text5 .splunk-textinput
          {
            width: 300px !important;
          }
          #text5 .splunk-textinput input{
            width: 300px !important;
          }
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;input id="text1" type="text" token="field1"&amp;gt;
        &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;input id="text2" type="text" token="field2"&amp;gt;
        &amp;lt;label&amp;gt;field2&amp;lt;/label&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;input id="text3" type="text" token="field3"&amp;gt;
        &amp;lt;label&amp;gt;field3&amp;lt;/label&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;input id="text4" type="text" token="field4"&amp;gt;
        &amp;lt;label&amp;gt;field4&amp;lt;/label&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;input id="text5" type="text" token="field5"&amp;gt;
        &amp;lt;label&amp;gt;field5&amp;lt;/label&amp;gt;
      &amp;lt;/input&amp;gt;      
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 04 Mar 2018 13:48:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/328563#M21305</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-04T13:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase the textbox size when you want to increase the size of 2 of the 5 text boxes in the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/328564#M21306</link>
      <description>&lt;P&gt;is it possible that we can disable one of the text boxes from input and make it display only&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 17:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/328564#M21306</guid>
      <dc:creator>subhrapan</dc:creator>
      <dc:date>2018-03-05T17:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase the textbox size when you want to increase the size of 2 of the 5 text boxes in the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/328565#M21307</link>
      <description>&lt;P&gt;There are two options that you can choose from:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Option 1&lt;/STRONG&gt;) Create &lt;CODE&gt;&amp;lt;html&amp;gt;&lt;/CODE&gt; panel with &lt;CODE&gt;text&lt;/CODE&gt; &lt;CODE&gt;input&lt;/CODE&gt; type and set the &lt;CODE&gt;disabled&lt;/CODE&gt; attribute&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;html&amp;gt;
    &amp;lt;input type="text" disabled="disabled" value="$someTextToken$"&amp;gt;&amp;lt;/input&amp;gt;
  &amp;lt;/html&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Option 2&lt;/STRONG&gt;) Use jQuery to set the &lt;CODE&gt;disabled attribute&lt;/CODE&gt; for &lt;CODE&gt;Splunk text input&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Refer to answer below which does this based on logged in user role. However, you just need to always set it to be disabled.&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/575377/can-i-restrict-permissions-for-the-text-box-drilld.html"&gt;https://answers.splunk.com/answers/575377/can-i-restrict-permissions-for-the-text-box-drilld.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Following is the JavaScript code for your scenario to disable Splunk text box input with id &lt;CODE&gt;text5&lt;/CODE&gt; (&lt;CODE&gt;disable_textbox.js&lt;/CODE&gt;).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; require([
      "jquery",
     "splunkjs/mvc/simplexml/ready!"
 ], function($) {
     $(document).ready( function() {
         // Disable TextBox Input with id="text5"
         $(".splunk-textinput [id^='text5']").attr( "disabled", "disabled" );
     });
 });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since this required JavaScript Extension to Simple XML, you would need to save the JavaScript file to your Splunk App's static folder i.e. &lt;CODE&gt;$SPLUNK_HOME/etc/apps/&amp;lt;YourAppName&amp;gt;/appserver/static/disable_textbox.js&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Form root node should point to the JavaScript file &lt;CODE&gt;disable_textbox.js&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form static="disable_textbox.js"&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This also may require Splunk restart/bump/refresh for the changes to take effect and also cleaning browser history may be required.&lt;/P&gt;

&lt;P&gt;Please try one of the approach and confirm.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 18:25:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/328565#M21307</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-05T18:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase the textbox size when you want to increase the size of 2 of the 5 text boxes in the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/520366#M34984</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@ niketnilay,&lt;/P&gt;&lt;P&gt;I am on 7.x and soon to be moved to 8.x. This solution is notworking on 7.x. Can you update please for 7.x and 8.x? Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 18:17:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/520366#M34984</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-09-18T18:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase the textbox size when you want to increase the size of 2 of the 5 text boxes in the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/530398#M36001</link>
      <description>&lt;P&gt;This solution works. Thanks!&lt;/P&gt;&lt;P&gt;But if there are more than one input box with larger width they are going to overlap each other. This is of course an "html" question, but can you help me to avoid this behaviour?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2020 09:18:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/530398#M36001</guid>
      <dc:creator>fabiofox</dc:creator>
      <dc:date>2020-11-23T09:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to increase the textbox size when you want to increase the size of 2 of the 5 text boxes in the dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/530867#M36086</link>
      <description>&lt;P&gt;I tried many things with up until Splunk 7.x. Finally, we upgraded to 8.0.6 (8.x) and below worked. No custom stylesheets etc. needed. Just use the below code and adjust for your need as needed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it works for you all, don't forget to thumbs up. Thanks.&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;form theme="light"&amp;gt;
  &amp;lt;label&amp;gt;Sample Text Box Sizing&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="true" autoRun="false"&amp;gt;
    &amp;lt;input id="splunk_input_text_1" type="text" token="text1" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;2 values&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;A,B&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;

    &amp;lt;input id="splunk_input_text_2" type="text" token="text2" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;5 values&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;A,B,C,D,E&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;

    &amp;lt;input id="splunk_input_text_3" type="text" token="text3" searchWhenChanged="false"&amp;gt;
      &amp;lt;label&amp;gt;8 values&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;A,B,C,D,E,F,G,H&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;

    &amp;lt;html&amp;gt;
      &amp;lt;style&amp;gt;
        #splunk_input_text_1{
          width: 200px !important;
          }
      &amp;lt;/style&amp;gt;
    &amp;lt;/html&amp;gt;

    &amp;lt;html&amp;gt;
        &amp;lt;style&amp;gt;
          #splunk_input_text_2{
            width: 300px !important;
          }
      &amp;lt;/style&amp;gt;
    &amp;lt;/html&amp;gt;

    &amp;lt;html&amp;gt;
      &amp;lt;style&amp;gt;
        #splunk_input_text_3{
          width: 600px !important;
          }
      &amp;lt;/style&amp;gt;
    &amp;lt;/html&amp;gt;
  &amp;lt;/fieldset&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 18:27:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-increase-the-textbox-size-when-you-want-to-increase-the/m-p/530867#M36086</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-11-25T18:27:23Z</dc:date>
    </item>
  </channel>
</rss>

