<?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: Is it possible to access values within HTML form objects rather than inputs? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383441#M25135</link>
    <description>&lt;P&gt;Try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
         'jquery',
         'splunkjs/mvc',
         'splunkjs/mvc/simplexml/ready!'
 ], function ($, mvc) {
         var tokens = mvc.Components.get("default");
         $('#buttonSummary').on("click", function (e){
                var firstname = $("input[name=firstname]").val();
                var lastname = $("input[name=lastname]").val();
                 tokens.set("tok_concatenated_inputs", firstname + lastname);
         });
 });
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 17 Sep 2018 14:18:42 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2018-09-17T14:18:42Z</dc:date>
    <item>
      <title>Is it possible to access values within HTML form objects rather than inputs?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383438#M25132</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm the process of designing a simple data entry form using Splunk, but I am worred that too many inputs (50+) will make the interface slow and unusable.  As an alternative, I'm trying to use a simple HTML form and then extract the values when a checkbox value is selected.  As a simple example, I have an HTML form that has two inputs: firstname and lastname&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
        &amp;lt;title&amp;gt;HTML Form&amp;lt;/title&amp;gt;
        &amp;lt;html&amp;gt;
            &amp;lt;div&amp;gt;
                &amp;lt;form&amp;gt;
                    First name: &amp;amp;lt;br/&amp;amp;gt;
                    &amp;lt;input type="text" name="firstname"/&amp;gt;&amp;amp;lt;br/&amp;amp;gt;
                    Last name:&amp;amp;lt;br/&amp;amp;gt;
                    &amp;lt;input type="text" name="lastname"/&amp;gt;
                &amp;lt;/form&amp;gt;
            &amp;lt;/div&amp;gt;
        &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I'd like to do is generate a result set based on those values by selecting a checkbox.  I want to concatenate the values from all of the form fields and then assign it to a single input.  Something along the lines of this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
        &amp;lt;input type="checkbox" token="tok_submit_values"&amp;gt;
            &amp;lt;choice value="Submitted"&amp;gt;Submit&amp;lt;/choice&amp;gt;
            &amp;lt;change&amp;gt;
                &amp;lt;condition match="$tok_submit_values$"="Submitted"&amp;gt;
                    &amp;lt;set token="tok_input_concatenation"&amp;gt;form.firstname + form.lastname&amp;lt;/set&amp;gt;
                &amp;lt;/condition&amp;gt;
                &amp;lt;condition&amp;gt;
                    &amp;lt;unset token="tok_input_concatenation"&amp;gt;&amp;lt;/unset&amp;gt;
                &amp;lt;/condition&amp;gt;
            &amp;lt;/change&amp;gt;
        &amp;lt;/input&amp;gt;
    &amp;lt;/panel&amp;gt;
&amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Once the value has been concatenated, I can use the &lt;CODE&gt;makeresults&lt;/CODE&gt; command to format the data before writing it to index.&lt;/P&gt;

&lt;P&gt;Is this possible?  Any pointers would be greatly appreciated!&lt;/P&gt;

&lt;P&gt;Best regards,&lt;/P&gt;

&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 11:40:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383438#M25132</guid>
      <dc:creator>andrewtrobec</dc:creator>
      <dc:date>2018-09-17T11:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to access values within HTML form objects rather than inputs?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383439#M25133</link>
      <description>&lt;P&gt;@andrewtrobec&lt;/P&gt;

&lt;P&gt;HTML inputs and Splunk Dashboard Inputs are so different.  You can not access HTML inputs by &lt;CODE&gt;form.firstname&lt;/CODE&gt;. But you can access it using javascript and set Splunk tokens.&lt;/P&gt;

&lt;P&gt;Steps:&lt;BR /&gt;
1) Create a javascript file.&lt;BR /&gt;
2) Create a function which can set/unset &lt;CODE&gt;tok_input_concatenation&lt;/CODE&gt;  token as per your requirements.&lt;BR /&gt;
3) Call created function on click of submit button. For assigning onclick on submit I suggest jquery.&lt;/P&gt;

&lt;P&gt;Below are some references for:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://dev.splunk.com/view/webframework-codeexamples/SP-CAAAE4M"&gt;http://dev.splunk.com/view/webframework-codeexamples/SP-CAAAE4M&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://dev.splunk.com/view/webframework-developapps/SP-CAAAEW3"&gt;http://dev.splunk.com/view/webframework-developapps/SP-CAAAEW3&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 12:51:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383439#M25133</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-09-17T12:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to access values within HTML form objects rather than inputs?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383440#M25134</link>
      <description>&lt;P&gt;I've managed to lay the groundwork, but I cannot access the two form inputs: firstname and lastname.  Here's what my script looks like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
        'jquery',
        'splunkjs/mvc',
        'splunkjs/mvc/simplexml/ready!'
], function ($, mvc) {
        var tokens = mvc.Components.get("default");
        $('#buttonSummary').on("click", function (e){
                tokens.set("tok_concatenated_inputs", firstname + lastname);
        });
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm still not sure how to access the two form fields as they are not regular tokens.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 13:58:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383440#M25134</guid>
      <dc:creator>andrewtrobec</dc:creator>
      <dc:date>2018-09-17T13:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to access values within HTML form objects rather than inputs?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383441#M25135</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
         'jquery',
         'splunkjs/mvc',
         'splunkjs/mvc/simplexml/ready!'
 ], function ($, mvc) {
         var tokens = mvc.Components.get("default");
         $('#buttonSummary').on("click", function (e){
                var firstname = $("input[name=firstname]").val();
                var lastname = $("input[name=lastname]").val();
                 tokens.set("tok_concatenated_inputs", firstname + lastname);
         });
 });
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Sep 2018 14:18:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383441#M25135</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-09-17T14:18:42Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to access values within HTML form objects rather than inputs?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383442#M25136</link>
      <description>&lt;P&gt;@andrewtrobec you can use @jconger ' s blog for binding jQuery with HTML input. &lt;A href="https://www.splunk.com/blog/2016/09/21/using-html5-input-types-on-splunk-forms.html"&gt;https://www.splunk.com/blog/2016/09/21/using-html5-input-types-on-splunk-forms.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You can also refer to the following answer on similar lines where HTML date input is used with jQuery: &lt;A href="https://answers.splunk.com/answers/627432/jquery-datepicker-in-splunk.html"&gt;https://answers.splunk.com/answers/627432/jquery-datepicker-in-splunk.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2018 15:10:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383442#M25136</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-09-17T15:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to access values within HTML form objects rather than inputs?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383443#M25137</link>
      <description>&lt;P&gt;Amazing!  Thank you for the guidance.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Sep 2018 05:56:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383443#M25137</guid>
      <dc:creator>andrewtrobec</dc:creator>
      <dc:date>2018-09-18T05:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to access values within HTML form objects rather than inputs?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383444#M25138</link>
      <description>&lt;P&gt;Hi @kamlesh_vaghela &lt;BR /&gt;
I have an issue while building my custom app in splunk.&lt;/P&gt;

&lt;P&gt;I have created a dashboard with a html having 2 form fields, name and id,&lt;BR /&gt;
so on submit, How could i get these values and update a json file on backend in app/bin folder.&lt;/P&gt;

&lt;P&gt;Do i need to specify an action tag in html or even if we use jquery how to get these values in python script which need to be executed on form  submit.&lt;/P&gt;

&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 12:20:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383444#M25138</guid>
      <dc:creator>swithinb</dc:creator>
      <dc:date>2019-12-18T12:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to access values within HTML form objects rather than inputs?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383445#M25139</link>
      <description>&lt;P&gt;@swithinb &lt;/P&gt;

&lt;P&gt;You can create Custom endpoint for that. Pass you HTML elements values using javascript and which executes your code in &lt;CODE&gt;bin&lt;/CODE&gt; folder. &lt;BR /&gt;
Refer below link.&lt;/P&gt;

&lt;P&gt;Custom Endpoints: Part 1 - Overview: &lt;A href="https://vimeo.com/194918433"&gt;https://vimeo.com/194918433&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This video provides an overview of what we will be building in Splunk to set up custom endpoints.&lt;/P&gt;

&lt;P&gt;And check Part 1 - 7 for more details.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2019 04:53:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383445#M25139</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-12-19T04:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to access values within HTML form objects rather than inputs?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383446#M25140</link>
      <description>&lt;P&gt;Thanks a lot @kamlesh_vaghela, this helped me sort out my issue.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2019 05:16:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383446#M25140</guid>
      <dc:creator>swithinb</dc:creator>
      <dc:date>2019-12-31T05:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to access values within HTML form objects rather than inputs?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383447#M25141</link>
      <description>&lt;P&gt;Glad to help you @swithinb&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Happy Splunking&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Dec 2019 14:17:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Is-it-possible-to-access-values-within-HTML-form-objects-rather/m-p/383447#M25141</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-12-31T14:17:48Z</dc:date>
    </item>
  </channel>
</rss>

