<?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: How to Stop SubmitButton when there is a validation error in the dashboard ? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-Stop-SubmitButton-when-there-is-a-validation-error-in-the/m-p/574322#M10188</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/75258"&gt;@jcraumer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I am new to JavaScript , could you elaborate a bit about the positioning of the if condition in the JavaScript ,please .&lt;/P&gt;</description>
    <pubDate>Wed, 10 Nov 2021 06:17:13 GMT</pubDate>
    <dc:creator>zacksoft_wf</dc:creator>
    <dc:date>2021-11-10T06:17:13Z</dc:date>
    <item>
      <title>How to Stop SubmitButton when there is a validation error in the dashboard ?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-Stop-SubmitButton-when-there-is-a-validation-error-in-the/m-p/574179#M10186</link>
      <description>&lt;P&gt;I have a field 'Value'&amp;nbsp; in dashboard that is being validated by an external .js .&lt;BR /&gt;When the validation match fails it shows the error message "Please input a valid Value". But when I ignore that message and hit submit button, it anyways submits that record.&lt;BR /&gt;I want the dashboard not to submit, until I input the field with correct values and no validation message comes.&lt;BR /&gt;I have so many input fields , but I am validating only the 'Value' field. And I don't want the user to be able to submit record while ignoring the validation message.&lt;BR /&gt;&lt;BR /&gt;===================================================&lt;BR /&gt;&amp;lt;input type="text" token="value" id="tkn_value_id" searchWhenChanged="true" depends="$some_condition$"&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Value&amp;lt;/label&amp;gt;&lt;BR /&gt;========================================&lt;BR /&gt;require([&lt;BR /&gt;'underscore',&lt;BR /&gt;'splunkjs/mvc',&lt;BR /&gt;'jquery',&lt;BR /&gt;"splunkjs/mvc/simplexml/ready!"&lt;BR /&gt;], function(_, mvc, $) {&lt;BR /&gt;var tkn_value = splunkjs.mvc.Components.getInstance("tkn_value_id");&lt;BR /&gt;tkn_value.on("change", function(e) {&lt;BR /&gt;console.log(e)&lt;BR /&gt;// e.preventDefault();&lt;BR /&gt;if (!isValueValid(e)) {&lt;BR /&gt;alert("Enter Valid Value")&lt;BR /&gt;return false;&lt;BR /&gt;}&lt;BR /&gt;})&lt;BR /&gt;function isValueValid(userInput) {&lt;BR /&gt;console.log(userInput)&lt;BR /&gt;var res = userInput.match(/(^\s|\"|\s$)/g)&lt;BR /&gt;if (res == null)&lt;BR /&gt;return true;&lt;BR /&gt;else&lt;BR /&gt;return false;&lt;BR /&gt;}&lt;BR /&gt;========================================================&lt;BR /&gt;})&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 11:40:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-Stop-SubmitButton-when-there-is-a-validation-error-in-the/m-p/574179#M10186</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2021-11-09T11:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to Stop SubmitButton when there is a validation error in the dashboard ?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-Stop-SubmitButton-when-there-is-a-validation-error-in-the/m-p/574209#M10187</link>
      <description>&lt;P&gt;Do not use the default submit button provided by the dashboard editor.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a custom button that will submit the form once validation is complete.&amp;nbsp; This can be done in the same Javascript file used for the validation but create a if statement that if the validation fails the form doesn't submit.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 14:42:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-Stop-SubmitButton-when-there-is-a-validation-error-in-the/m-p/574209#M10187</guid>
      <dc:creator>jcraumer</dc:creator>
      <dc:date>2021-11-09T14:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to Stop SubmitButton when there is a validation error in the dashboard ?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-Stop-SubmitButton-when-there-is-a-validation-error-in-the/m-p/574322#M10188</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/75258"&gt;@jcraumer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I am new to JavaScript , could you elaborate a bit about the positioning of the if condition in the JavaScript ,please .&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 06:17:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-Stop-SubmitButton-when-there-is-a-validation-error-in-the/m-p/574322#M10188</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2021-11-10T06:17:13Z</dc:date>
    </item>
  </channel>
</rss>

