<?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>question Re: Onsubmit catalog client script not working properly in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347703#M919771</link>
    <description>&lt;P&gt;Thanks for this solution this sounds and works better.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2022 12:35:19 GMT</pubDate>
    <dc:creator>Aindrila Mondal</dc:creator>
    <dc:date>2022-10-11T12:35:19Z</dc:date>
    <item>
      <title>Onsubmit catalog client script not working properly</title>
      <link>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347592#M919728</link>
      <description>&lt;P&gt;Onsubmit catalog client script not working properly. Need to display an errormessage for some specific countries selected on the catalog form &amp;amp; disable the submit button simultaneously. We have written an on submit client script for that where we are checking the condition and then returning false, which seems to work perfectly but only the first time we click on submit button.&lt;/P&gt;&lt;P&gt;If someone modifies to a correct country and then click on onsubmit again, submit functionality doesn't seem to work&amp;nbsp; and request is not getting raised.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;snap of the onsubmit script:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AindrilaMondal_0-1665488400916.png" style="width: 580px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/207894i4080F83700660EA3/image-dimensions/580x282?v=v2" width="580" height="282" role="button" title="AindrilaMondal_0-1665488400916.png" alt="AindrilaMondal_0-1665488400916.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help regarding the same is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Aindrila&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 11:42:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347592#M919728</guid>
      <dc:creator>Aindrila Mondal</dc:creator>
      <dc:date>2022-10-11T11:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Onsubmit catalog client script not working properly</title>
      <link>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347611#M919732</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Have you tried adding additional alerts in same script? Please track where exactly it is failing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be helpful to identify what is happening. Also you can comment the &lt;STRONG&gt;return true;&amp;nbsp;&lt;/STRONG&gt;line, it is not required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 11:55:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347611#M919732</guid>
      <dc:creator>Anil Lande</dc:creator>
      <dc:date>2022-10-11T11:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Onsubmit catalog client script not working properly</title>
      <link>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347614#M919734</link>
      <description>&lt;P&gt;hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please apply alert or g_form.addinfomessage to check what value is coming in country everytime and also apply the same inside if and else bracket to check which bracket the code is entering for both the scenarios.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know what did you get from the alerts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please mark my answer correct based on Impact&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 11:53:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347614#M919734</guid>
      <dc:creator>Saurav11</dc:creator>
      <dc:date>2022-10-11T11:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: Onsubmit catalog client script not working properly</title>
      <link>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347633#M919743</link>
      <description>&lt;P&gt;I added alerts and the script is working fine the value of the country is also coming correct and all scenarios are working,but only the first time.Like example i select the country 'Russian federation' and click on submit so in this case the error mesaage should come and submit buttom should grey out which is working great.But then without reloading the form if i change the value of the country to say may be'India' for which the request should get submitted,in that case the submit button is still grey out the request is not getting submitted and the onsubmit script is also not getting called .But again if i reload the form anfd then select 'India' and try to submit it works fine then.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 12:05:48 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347633#M919743</guid>
      <dc:creator>Aindrila Mondal</dc:creator>
      <dc:date>2022-10-11T12:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Onsubmit catalog client script not working properly</title>
      <link>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347634#M919744</link>
      <description>&lt;P&gt;I added alerts and the script is working fine the value of the country is also coming correct and all scenarios are working,but only the first time.Like example i select the country 'Russian federation' and click on submit so in this case the error mesaage should come and submit buttom should grey out which is working great.But then without reloading the form if i change the value of the country to say may be'India' for which the request should get submitted, in that case the submit button is still grey out the request is not getting submitted and the onSubmit script is also not getting called .But again if i reload the form anfd then select 'India' and try to submit it works fine then.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 12:06:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347634#M919744</guid>
      <dc:creator>Aindrila Mondal</dc:creator>
      <dc:date>2022-10-11T12:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Onsubmit catalog client script not working properly</title>
      <link>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347669#M919755</link>
      <description>&lt;P&gt;Yeah that is because, the onsubmit cline script will only when there is a submit action performed on the portal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would suggest you this:- Change the script to Onchange client script and then if the user select wring country you show them the error message but also clear out the country field using g_form.clearValue('countryvariablename').&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So this way you will be able to show them the error message and they will also have to select the correct country before proceeding further&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please mark my country as correct based on Impact.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 12:16:52 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347669#M919755</guid>
      <dc:creator>Saurav11</dc:creator>
      <dc:date>2022-10-11T12:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Onsubmit catalog client script not working properly</title>
      <link>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347703#M919771</link>
      <description>&lt;P&gt;Thanks for this solution this sounds and works better.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 12:35:19 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/onsubmit-catalog-client-script-not-working-properly/m-p/2347703#M919771</guid>
      <dc:creator>Aindrila Mondal</dc:creator>
      <dc:date>2022-10-11T12:35:19Z</dc:date>
    </item>
  </channel>
</rss>

