Dashboards & Visualizations

Submit Button not working

nabeel652
Builder

Everything works fine until I add a submit button. Can someone tell me what is the problem with this dashboard.

Not getting any error message but Submit button simply doesn't work. When I change options in the input controls sometimes it is just submitted to the panel without pressing the submit button and sometime doesn't event after pressing the submit button.

<form>
  <label>Test Dashboard</label>
  <fieldset autoRun="false" submitButton="true">
    <input type="text" token="kwsearch">
      <label>Keyword</label>
      <change>
        <eval token="form.result">if($form.exact$=="0","*".$form.kwsearch$."*",$form.kwsearch$)</eval>
      </change>
    </input>
    <input type="radio" token="exact">
      <label>Exact Match</label>
      <choice value="0">False</choice>
      <choice value="1">True</choice>
      <default>0</default>
      <initialValue>0</initialValue>
      <change>
        <eval token="form.result">if($form.exact$=="0","*".$form.kwsearch$."*",$form.kwsearch$)</eval>
      </change>
    </input>
    <input type="text" token="result">
      <label>Result</label>
    </input>
  </fieldset>
  <row>
    <panel>
      <title>Results=== $form.result$       exact===$form.exact|s$</title>
      <table>
        <search>
          <query>| makeresults | fields - _time | eval Product="$form.result$" | table Product</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="count">10</option>
        <option name="drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </table>
    </panel>
  </row>
</form>
1 Solution

niketn
Legend

@nabeel652 refer to some of my previous answers for Submit Button behavior with reference to Default Token Model and Submitted Token model. Hope it clarifies the concept and proper user case and workaround.

https://answers.splunk.com/answers/679596/what-is-the-expected-behavior-for-submit-button-wh.html
https://answers.splunk.com/answers/742451/searchwhenchangedfalse-not-honored-1.html

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

@nabeel652 refer to some of my previous answers for Submit Button behavior with reference to Default Token Model and Submitted Token model. Hope it clarifies the concept and proper user case and workaround.

https://answers.splunk.com/answers/679596/what-is-the-expected-behavior-for-submit-button-wh.html
https://answers.splunk.com/answers/742451/searchwhenchangedfalse-not-honored-1.html

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

DavidHourani
Super Champion

Hi @nabeel562, what kind of error messages are you getting ?

0 Karma

nabeel652
Builder

@DavidHourani
Well not getting any message but Submit button simply doesn't work. When I change options in the input controls sometimes it is just submitted to the panel without pressing the submit button and sometime doesn't event after pressing the submit button.

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...