<?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: String Validation (starts with) in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386813#M43739</link>
    <description>&lt;P&gt;ServiceNow also supprots Regex so use &lt;A href="http://wiki.servicenow.com/index.php?title=SNC_Regex_API#gsc.tab=0" title="http://wiki.servicenow.com/index.php?title=SNC_Regex_API#gsc.tab=0"&gt;SNC Regex API - ServiceNow Wiki&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 20 Dec 2016 20:32:46 GMT</pubDate>
    <dc:creator>Raju Koyagura</dc:creator>
    <dc:date>2016-12-20T20:32:46Z</dc:date>
    <item>
      <title>String Validation (starts with)</title>
      <link>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386812#M43738</link>
      <description>&lt;P&gt;Greetings all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm looking for some assistance on syntax for a series of start withs&lt;BR /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IE if it startswith ABC, or XYZ or CAT.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I know it's a on change script for the variable, just not sure on how to match characters. (case insensitive)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2016 20:29:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386812#M43738</guid>
      <dc:creator>Derek10</dc:creator>
      <dc:date>2016-12-20T20:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: String Validation (starts with)</title>
      <link>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386813#M43739</link>
      <description>&lt;P&gt;ServiceNow also supprots Regex so use &lt;A href="http://wiki.servicenow.com/index.php?title=SNC_Regex_API#gsc.tab=0" title="http://wiki.servicenow.com/index.php?title=SNC_Regex_API#gsc.tab=0"&gt;SNC Regex API - ServiceNow Wiki&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Dec 2016 20:32:46 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386813#M43739</guid>
      <dc:creator>Raju Koyagura</dc:creator>
      <dc:date>2016-12-20T20:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: String Validation (starts with)</title>
      <link>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386814#M43740</link>
      <description>&lt;P&gt;Here is the sample script&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;function onChange(control, oldValue, newValue, isLoading, isTemplate) {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; if (isLoading || newValue === '') {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; //Type appropriate comment here, and begin script below&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; if (newValue.match(/^ABC|XYZ|CAT/i))&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return true;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; else{&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert('Fail');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g_form.clearValue('&lt;STRONG&gt;You Field Name&lt;/STRONG&gt;');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Dec 2016 21:07:39 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386814#M43740</guid>
      <dc:creator>dvp</dc:creator>
      <dc:date>2016-12-20T21:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: String Validation (starts with)</title>
      <link>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386815#M43741</link>
      <description>&lt;P&gt;Here's one way to do it using &lt;SPAN style="font-family: courier new,courier;"&gt;test()&lt;/SPAN&gt;:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14822696784531087 jive_text_macro" data-renderedposition="50.89999771118164_8_932_16" jivemacro_uid="_14822696784531087"&gt;&lt;P&gt;if (/^(ABC|XYZ|CAT)/i.test(value)) { &amp;nbsp; /* process TRUE condition */ &amp;nbsp; } &amp;nbsp; // starts with ABC or XYZ or CAT, ignore case&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;EM&gt;Please feel free to connect, follow, mark helpful / answer, like, endorse.&lt;/EM&gt;&lt;/P&gt;&lt;BR /&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="width: 172px;"&gt;John Chun, &lt;SPAN style="font-size: 8pt;"&gt;PhD PMP&lt;/SPAN&gt; &lt;A href="http://linkedin.com/in/DrJohnChun"&gt;&lt;IMG alt="see John's LinkedIn profile" class="image-2 jive-image" src="http://megaicons.net/static/img/icons_sizes/182/456/16/linkedin-icon.png" style="height: auto; vertical-align: -13px;" title="see John's LinkedIn profile" /&gt;&lt;/A&gt;&lt;P&gt;&lt;A href="http://snowaid.com/"&gt;&lt;IMG alt="visit snowaid" class="image-1 jive-image" src="http://snowaid.com/images/signature.png" style="height: auto; margin-top: -9px;" title="visit snowaid" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A _jive_internal="true" href="https://www.servicenow.com/people/drjohnchun/content"&gt;&lt;IMG alt="ServiceNow Advocate" class="image-3 jive-image" src="http://snowaid.com/images/sn_advocate_135x48.png" style="margin-top: -3px;" /&gt;&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;A title="" _jive_internal="true" href="https://www.servicenow.com/community?id=community_forum&amp;amp;sys_id=76299a2ddbd897c068c1fb651f96196a"&gt;Winner of November 2016 Members' Choice Award&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Dec 2016 21:35:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386815#M43741</guid>
      <dc:creator>drjohnchun</dc:creator>
      <dc:date>2016-12-20T21:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: String Validation (starts with)</title>
      <link>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386816#M43742</link>
      <description>&lt;P&gt;Thank you all for your assistance, all of you have been helpful in this. I had to mark the most useful as correct as it directly correlated to my scenario. But I appreciate the other two and can reference them as well in future endeavors!.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 13:23:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386816#M43742</guid>
      <dc:creator>Derek10</dc:creator>
      <dc:date>2016-12-21T13:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: String Validation (starts with)</title>
      <link>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386817#M43743</link>
      <description>&lt;P&gt;This on-change client script worked perfectly for me - We have two fields on our work orders that require information from another system and folks were always entering the wrong things. Here's my version:&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function onChange(control, oldValue, newValue, isLoading, isTemplate) {


    if (isLoading || newValue === '') {

        return;
    }

    //Type appropriate comment here, and begin script below
	
    if (newValue.match(/^SO/i))

    {

        return true;

    } else {

        alert('The Sales Order number must begin with SO...');

        g_form.clearValue('u_salesorder');

    }
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Mar 2020 20:33:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/string-validation-starts-with/m-p/1386817#M43743</guid>
      <dc:creator>Julie Benningfi</dc:creator>
      <dc:date>2020-03-31T20:33:45Z</dc:date>
    </item>
  </channel>
</rss>

