Checkbox value true/false
<p>I have a form with checkbox and I want to keep it checked after submitting the form when it goes back to the same view with an error. I heard that the value attribute can help me to make the checkbox be checked so im trying to set it to true/false. Anyway, the input value stays "false" even if I click it. What happens exactly?
I thought the value goes true/false after clicking the checkbox</p>

<pre><code>&lt;input type="checkbox" name="acceptRules" class="inline checkbox" id="checkbox1" value="false"&gt;

      &lt;script&gt;
          $("#checkbox1").is(':checked', function(){
              $("#checkbox1").attr('value', 'true');
          });
      &lt;/script&gt;
</code></pre>