title: How to check if a checkbox is checked in contact form 7?
body: <p>To begin with, I have a contact form that looks like this:</p>
  <p><a href="https://i.stack.imgur.com/gIYHY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gIYHY.png" alt="enter image description here" /></a></p>
  <p>The <code>contact form 7 editor</code> code is:</p>
  <pre><code>&lt;input type=&quot;checkbox&quot; id=&quot;katoikia&quot; name=&quot;tracking-777&quot;&gt;Tracking Acceptance&lt;/input&gt;
  
  &lt;label&gt; Your Name:
      [text* your-name] &lt;/label&gt;
  
  &lt;label&gt; Email:
      [email* your-email] &lt;/label&gt;
  
  &lt;label&gt; Subject
      [text* your-subject] &lt;/label&gt;
  
  &lt;label&gt; Your message (optional):
      [textarea your-message] &lt;/label&gt;
  
  [submit &quot;Submit&quot;]
  </code></pre>
  <p>I want to check if the checkbox I have is checked and if it's checked I Want to track the contact form fields. But I struggle to find a way to achieve the <code>if statement</code> check.</p>
  <p>I used this piece of <strong>javascript</strong> but it doesn't work at all:</p>
  <pre><code>&lt;script&gt;
      $(document).ready(function() {
      $('#katoikia').change(function() {
          // CHANGED THIS SELECTOR
          if ($('#katoikia').is(':checked')) {
              alert('Checked');
          } else {
              alert('Unchecked!');
          }
      });
  });
  &lt;/script&gt;
  </code></pre>
  <p><strong>Question</strong>: How can I check if the checkbox is checked or not and accordingly do 'something'?</p>
  <p><strong>Note</strong>: Feel free to give brief explanation of where or why I should use what you will suggest me to, plus make sure to let me know if using the code in the <code>contact form 7 editor</code> is ok or not.</p>