title: Opt-in / Opt-out Checkbox
body: <p>I am trying to create a simple way to force a single checkbox to display "No" in a form submission if left unchecked, or clicked off. I've tried a number of ways and this is the closest I can get, but it still isn't working properly.</p>
  
  <p>Any help is much appreciated.
  Matt</p>
  
  <pre><code>$(function opt() {
          if ($("#optIn").is(":checked")) {
              $("#optIn").value="Yes"
              $("#optIn").click(function() { this.value="No" })
          } else {
              $("#optIn").value="No"
              $("#optIn").click(function() { this.value="Yes" })
          }
      return false
  });
  
  opt();
  </code></pre>