Dashboards & Visualizations

input textbox

chuck_life09
Path Finder

hi,

I have one text input field in my dashboard. It is a mandatory field.

Want to make sure there is some value in it before getting submitted.

But it takes blank too and gets submitted.

Like when we click on the text field and not enter any value too its considering as value and getting submitted.

I tried "searchwhenchanged" not working

and "Prefix and Suffix" too not working.

<input type="text" token="abc" searchWhenChanged="true">
<label>abc</label>
<change>
<condition match="$value$!=&quot;*&quot;"></condition>
</change>
<prefix>NOT (</prefix>
<suffix>)</suffix>
</input>

Want to have some value , it should not take blank spaces alone also... 

Labels (1)
Tags (1)
0 Karma

chuck_life09
Path Finder

hi@kamlesh_vaghela ,

Thanks this solution works like if i am not giving any value in the input text and submitting it, it is not submitting. but can there be a prompt that no input in it?  is it possible?

One more thing is that if i just click on the text field and give submit it is getting stored as empty. just the click of cursor is taking an input. its an exception case.

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@chuck_life09 

 

You can try something like this.

 

<form>
  <label>Input Text</label>
  <fieldset submitButton="false">
    <input type="text" token="abc">
      <label>My Value</label>
      <change>
        <condition match="$value$!=&quot;&quot;">
          <set token="tmpAbc">$value$</set>
        </condition>
        <condition>
          <unset token="tmpAbc"></unset>
        </condition>
      </change>
      <prefix>NOT (</prefix>
      <suffix>)</suffix>
    </input>
  </fieldset>
  <row>
    <panel>
      <table>
        <title>Test $tmpAbc$</title>
        <search>
          <query>| makeresults | eval myVal="$tmpAbc$"</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</form>
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...