title: Running javascript when document loads
body: <p>I am trying to implement a script that will enable a submit button once a check-box is checked.</p>
  
  <p>I am following an example found here: <a href="http://jsfiddle.net/chriscoyier/BPhZe/76/" rel="nofollow">http://jsfiddle.net/chriscoyier/BPhZe/76/</a> </p>
  
  <p>I have added the following java-script code to my page but it doesn't seem like the script is executing properly. I do not see any errors in the console however.</p>
  
  <pre><code>&lt;!---JQuery Iniialization ---&gt;
  &lt;link rel="stylesheet"    href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css"&gt;
  &lt;script src="//code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
  &lt;script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"&gt;&lt;/script&gt;
  
  &lt;script&gt;
  $( document ).ready(function() {
      var checkboxes = $("input[type='checkbox']"),
          submitButt = $("input[type='submit']");
  
      checkboxes.click(function() {
          submitButt.attr("disabled", !checkboxes.is(":checked"));
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Form Code:</p>
  
  <pre><code> &lt;FORM ACTION="signature_action.cfm?ticket_id=#url.ticket_id#&amp;device=pc" METHOD=POST NAME="SigForm"&gt;
  
        &lt;div align="center"&gt;
        &lt;h2&gt;STEP 1&lt;/h2&gt;
        &lt;strong&gt;Select the type of signature that is being captured:&lt;/strong&gt;&lt;br /&gt;
         &lt;table&gt;&lt;tr&gt;&lt;td align="left"&gt; 
                              &lt;div id="format"&gt;
                              &lt;input name="equipment_dropped_off" type="checkbox" id="check1" value="equipment_dropped_off" /&gt;
                              &lt;label for="check1"&gt;&lt;span class="style1"&gt;Equipment Dropped Off &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/label&gt;
                              &lt;span class="style1"&gt;
                              &lt;input name="work" type="checkbox" id="check2" value="work"/&gt;
                              &lt;label for="check2"&gt;Work performed &amp;nbsp; &amp;nbsp; &lt;/label&gt;
                              &lt;input name="payment" id="check3" type="checkbox" value="payment" /&gt;
                              &lt;label for="check3"&gt;Payment Recieved &amp;nbsp; &amp;nbsp; &lt;/label&gt;
                              &lt;input name="equipment_picked_up" id="check4" type="checkbox" value="equipment_picked_up" /&gt;
                              &lt;label for="check4"&gt;Equipment Picked Up&lt;/label&gt;
                              &lt;/span&gt;&lt;br /&gt;
                              &lt;input name="tech_name" type="hidden" value="#url.tech_name#"&gt;
                              &lt;/div&gt;
                              &lt;input name="hidden" type="hidden" value="#url.tech_name#"&gt;
  
  &lt;input type="submit" name="submit" value="STEP 4 - SAVE SIGNATURE" disabled&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I am new to javascript and I am strugling a bit. Doesn't this need to run once the DOM is ready? (I am not sure how to do that!)</p>
  
  <p>Can someone point me in the right direction?</p>