Dashboards & Visualizations

is it possible to create a text input with some predefined dropdown value?

sanjai
Path Finder

i'm having a thought , that a text input box which has a dropdown and also able to enter text input with a single token, i am not sure this will works , needed guidance

Thanks in Advance.

Sanjai S


Labels (1)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

@sanjai If you haven't already found it, you can use allowCustomValues in the dropdown XML to allow a user to enter a custom text value as well as choosing from a dropdown.

The the dropdown section here

https://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#input_.28form...

 

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

@sanjai If you haven't already found it, you can use allowCustomValues in the dropdown XML to allow a user to enter a custom text value as well as choosing from a dropdown.

The the dropdown section here

https://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#input_.28form...

 

sanjai
Path Finder

Hi @bowesmana ,

The allowCustomValues attribute indeed works well, but my requirement is slightly different. I have a text input box inside an HTML tag that receives cron input from the user, and this input is then processed with a JavaScript file. Here, I'm attempting to implement a dropdown where the user can either select from predefined cron expressions or enter their own.

Here's the content of my HTML tag:


<html>
<div>
<input type="text" id="cron_input" placeholder="Enter cron expression (optional)" name="cron_command" />
</div>
<div>
<p/>
<button id="save_cron_input" class="btn-primary">Save</button>
</div>
</html>

Is it possible to include a dropdown with allowCustomValue inside the HTML tag (as depicted in the image below)? I aim to provide some default cron expressions to the user.

sanjai_0-1711435692227.png

The main goal of this configuration is to gather input (cron expressions) from the user. Additionally, I've included some basic cron expressions in the dropdown so the user can either select from them or enter their own.

Thank you for your assistance!

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Unfortunately, I don't know if you can make <select> input take custom values, that's more of an html question if you are doing it inside the html panels - I am guessing you can probably make some JS to make this this work, but it's a guess.

0 Karma

sanjai
Path Finder

Thank you @bowesmana  . I'm also considering implementing the select value in JavaScript 🙂. Appreciate your time.

0 Karma

sanjai
Path Finder

@bowesmana  thanks . its helpful

0 Karma
Get Updates on the Splunk Community!

Accelerate Service Onboarding, Decomposition, Troubleshooting - and more with ITSI’s ...

Accelerate Service Onboarding, Decomposition, Troubleshooting - and more! Faster Time to ValueManaging and ...

New Release | Splunk Enterprise 9.3

Admins and Analyst can benefit from:  Seamlessly route data to your local file system to save on storage ...

2024 Splunk Career Impact Survey | Earn a $20 gift card for participating!

Hear ye, hear ye! The time has come again for Splunk's annual Career Impact Survey!  We need your help by ...