Hello,
I have a dashboard and I'd like to add a submit button because if I change something the search is launch by automatically.
I'd like to set everything first in the checkbox then the input field then launch the search with a submit button.
I've tried to add a button but in this case I'm not able to choose the other checkbox options, only the 'Any field'.
Could you please help the modification?
<form version="1.1" theme="light">
<label>Multiselect Text</label>
<init>
<set token="toktext">*</set>
</init>
<fieldset submitButton="false">
<input type="checkbox" token="tokcheck">
<label>Field</label>
<choice value="Any field">Any field</choice>
<choice value="category">Group</choice>
<choice value="severity">Severity</choice>
<default>category</default>
<valueSuffix>=REPLACE</valueSuffix>
<delimiter> OR </delimiter>
<prefix>(</prefix>
<suffix>)</suffix>
<change>
<eval token="form.tokcheck">case(mvcount('form.tokcheck')=0,"category",isnotnull(mvfind('form.tokcheck',"Any field")),"Any field",1==1,'form.tokcheck')</eval>
<eval token="tokcheck">if('form.tokcheck'="Any field","REPLACE",'tokcheck')</eval>
<eval token="tokfilter">if($form.tokcheck$!="Any field",replace($tokcheck$,"REPLACE","\"".$toktext$."\""),$toktext$)</eval>
</change>
</input>
<input type="text" token="toktext">
<label>Value</label>
<default>*</default>
<change>
<eval token="tokfilter">if($form.tokcheck$!="Any field",replace($tokcheck$,"REPLACE","\"".$toktext$."\""),$toktext$)</eval>
</change>
</input>
</fieldset>
<row>
<panel>
<event>
<title>$tokfilter$</title>
<search>
<query>index=* $tokfilter$</query>
<earliest>-24h@h</earliest>
<latest>now</latest>
</search>
<option name="refresh.display">progressbar</option>
</event>
</panel>
</row>
</form>
Thank you very much in advance!
Change the submitButton="false" to "true"
What's your intention with this <change> block on the multiselect - you are overwriting the field, so that' s why you cannot change things there because when you click something, your eval statements change things back again.
<change>
<eval token="form.tokcheck">case(mvcount('form.tokcheck')=0,"category",isnotnull(mvfind('form.tokcheck',"Any field")),"Any field",1==1,'form.tokcheck')</eval>
<eval token="tokcheck">if('form.tokcheck'="Any field","REPLACE",'tokcheck')</eval>
<eval token="tokfilter">if($form.tokcheck$!="Any field",replace($tokcheck$,"REPLACE","\"".$toktext$."\""),$toktext$)</eval>
</change>