title: Jquery scr tag not being called when users navigate to new page
body: <p>I have the following script on our website. When users navigate to this page, the script tag does not fire for some reason. But when users refresh that exact page, the javascript starts working.</p>
  <p>It doesn't work the first time, but when they load the page a second time, it appears to work!</p>
  <p>So why is this happening? Ajax.</p>
  <p>The page is using Ajax, a feature that allows parts of a page to be loaded, without loading the full page.</p>
  <p>For example, when a visitor wants to open a new page, it could be opened without reloading the header and footer. It can also power a feature called 'Infinite Scroll' where only the first few blog posts are loaded initially but as the visitor scrolls down the page, more blog posts download and appear. It will continue loading blog content until all of the posts have been displayed, hence appearing to be an infinitely long page.</p>
  <p>The downside is that when you have Ajax enabled, older JavaScript code that wasn't written to work with Ajax, won't work properly.</p>
  <p>The best solution is to source new Ajax-enabled code.</p>
  <p>We have the following website page: includedhealth.com/member</p>
  <p>When users navigate to- includedhealth.com/lookingforassistance to submit a request the script will say &quot;Required field Missing&quot;.</p>
  <p>Yet if they refresh the page, it will magically start working.</p>
  <pre><code>&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js&quot;&gt;&lt;/script&gt;
  </code></pre>
  <p>How can we force this line of code with the document loads? I believe that when a user navigates to the page with this code, that its not loading. But for some reason, when the user refreshes the page, the javascript library is called and all works.</p>
  <p>Below is the script along with the form. I am trying to understand how I can load this every time on load.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
    // Jquery Script Tag
  
  
    // You can use this expression:
    // $('div.checkbox-group.required :checkbox:checked').length &gt; 0
    // which returns true if at least one element is checked. Based on that, you can implement your validation check.
  
  
    $(document).ready(function() {
      $('#submitBtn').click(function() {
  
        // Web_Care_Recipient_Group START
        // Finds all of this group
        Web_Care_Recipient_Group = $("input[name='00N4x00000OQDyw']");
        // Check to see if any in the group have been checked
        Web_Care_Recipient_checked = $("input[name='00N4x00000OQDyw']:checked").length;
        // Get all in the group to have the property "required"
        Web_Care_Recipient_Group.prop('required', true);
        // IF one of these has
        if (Web_Care_Recipient_checked) {
          Web_Care_Recipient_Group.prop('required', false);
        }
        // Web_Care_Recipient_Group END
  
  
  
        // Web_Provider_Type_Group START
        // Finds all of this group
        Web_Provider_Type_Group = $("input[name='00N4x00000OQDz6']");
        // Check to see if any in the group have been checked
        Web_Provider_Type_checked = $("input[name='00N4x00000OQDz6']:checked").length;
        // Get all in the group to have the property "required"
        Web_Provider_Type_Group.prop('required', true);
        // IF one of these has
        if (Web_Provider_Type_checked) {
          Web_Provider_Type_Group.prop('required', false);
        }
        // Web_Provider_Type_Group END
  
  
        // Web_Request_Timing_Group START
        // Finds all of this group
        Web_Request_Timing_Group = $("input[name='00N4x00000OQDzV']");
        // Check to see if any in the group have been checked
        Web_Request_Timing_checked = $("input[name='00N4x00000OQDzV']:checked").length;
        // Get all in the group to have the property "required"
        Web_Request_Timing_Group.prop('required', true);
        // IF one of these has
        if (Web_Request_Timing_checked) {
          Web_Request_Timing_Group.prop('required', false);
        }
        // Web_Request_Timing_Group END
  
        // Web_Relationship_to_Insurance_Sponsor_Group START
        // Finds all of this group
        Web_Relationship_to_Insurance_Sponsor_Group = $("input[name='00N4x00000OQE04']");
        // Check to see if any in the group have been checked
        Web_Relationship_to_Insurance_Sponsor_Checked = $("input[name='00N4x00000OQE04']:checked").length;
        // Get all in the group to have the property "required"
        Web_Relationship_to_Insurance_Sponsor_Group.prop('required', true);
        // IF one of these has
        if (Web_Relationship_to_Insurance_Sponsor_Checked) {
          Web_Relationship_to_Insurance_Sponsor_Group.prop('required', false);
        }
        // Web_Relationship_to_Insurance_Sponsor_Group END
  
  
        // Web_Gender_Pronouns_Group START
        // Finds all of this group
        Web_Gender_Pronouns_Group = $("input[name='00N4x00000OPo7w']");
        // Check to see if any in the group have been checked
        Web_Gender_Pronouns_Checked = $("input[name='00N4x00000OPo7w']:checked").length;
        // Get all in the group to have the property "required"
        Web_Gender_Pronouns_Group.prop('required', true);
        // IF one of these has
        if (Web_Gender_Pronouns_Checked) {
          Web_Gender_Pronouns_Group.prop('required', false);
        }
        // Web_Gender_Pronouns_Group END
  
  
  
        // Web_Identity_Group START
        // Finds all of this group
        Web_Identity_Group = $("input[name='00N4x00000OQE2o']");
        // Check to see if any in the group have been checked
        Web_Identity_Checked = $("input[name='00N4x00000OQE2o']:checked").length;
        // Get all in the group to have the property "required"
        Web_Identity_Group.prop('required', true);
        // IF one of these has
        if (Web_Identity_Checked) {
          Web_Identity_Group.prop('required', false);
        }
        // Web_Identity_Group END
  
        // Web_Race_Ethnicity_Group START
        // Finds all of this group
        Web_Race_Ethnicity_Group = $("input[name='00N4x00000OQE3D']");
        // Check to see if any in the group have been checked
        Web_Race_Ethnicity_Checked = $("input[name='00N4x00000OQE3D']:checked").length;
        // Get all in the group to have the property "required"
        Web_Race_Ethnicity_Group.prop('required', true);
        // IF one of these has
        if (Web_Race_Ethnicity_Checked) {
          Web_Race_Ethnicity_Group.prop('required', false);
        }
        // Web_Race_Ethnicity_Group END
  
      });
    });
  &lt;/script&gt;
  
  &lt;form action="https://salesforce.com/servlet/servlet.WebToCase?encoding=UTF-8" method="POST"&gt;
  
  
    &lt;input type=hidden name="retURL" value="https://www.company.com/request-thank-you"&gt;
  
    &lt;!--  ----------------------------------------------------------------------  --&gt;
    &lt;!--  NOTE: These fields are optional debugging elements. Please uncomment    --&gt;
    &lt;!--  these lines if you wish to test in debug mode.                          --&gt;
    &lt;!--  &lt;input type="hidden" name="debug" value=1&gt;                              --&gt;
    &lt;!--  &lt;input type="hidden" name="debugEmail" value="matt@pandd.io"&gt;           --&gt;
    &lt;!--  ----------------------------------------------------------------------  --&gt;
    &lt;div class="field-set"&gt;
      &lt;div class="label"&gt;
        Name *
      &lt;/div&gt;
      &lt;div class="description"&gt;
        Please use the same name used in your member form.
      &lt;/div&gt;
      &lt;br&gt;
      &lt;div class="name-label-left"&gt;
        &lt;input class="input-text" id="00N4x00000OPo6A" maxlength="255" name="00N4x00000OPo6A" size="20" type="text" required /&gt;&lt;br&gt;
        &lt;div class="description"&gt;
          First Name
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;input class="button-submit" type="submit" name="submit" id="submitBtn"&gt;
  
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>