Assigning value to checkbox?
<p>Ok thanks to the guys on here we have sorted functions for checkbox click, and are now using unobtrusive js.</p>

<p>What I want to achieve is..</p>

<p>We have a form, and on submit with checkbox unclicked, the form submits as it would normally...</p>

<p>But.. I have added an option to click checkbox, and display hidden content .. which I want to be part of same form, but with additional values etc..</p>

<p>Essentially...</p>

<p>if checkbox is unchecked, show standard submit button.</p>

<p>if checkbox is clicked, hide standard button and toggle additional form elements and new submit button.</p>

<p>The issue I am facing is :</p>

<ol>
<li>passing a numeric value onclick from the checkbox, so need set to 1 or 0 
0 being standard do nothing
1 hiding submit button, and toggling hidden additional form fields.</li>
</ol>

<p>I can get the toggle working, but onclick of the checkbox it doesnt do anything.</p>

<p>I am also baffled as to hide the submit button ( normally displayed ) if checkbox is clicked.</p>

<p>script for hidden element:</p>

<pre><code>$('.styledCheckbox').change(function() {
    if ($(this).val() != "0") {
    $('.extraForm').show('fast');
    }else if ($(this).val() == "0") {
    $('.extraForm').hide('fast');
}
</code></pre>

<p>});</p>

<p>script for the checkbox:</p>

<pre><code> $(function(){
  $('.styledCheckbox').click(function(){
    setCheckboxDisplay(this);
  });
});
</code></pre>

<p>html for the checkbox:</p>

<pre><code>&lt;input name="include" type="checkbox" id="checkbox"  class="styledCheckbox" /&gt;
</code></pre>

<p>hidden div</p>

<pre><code>&lt;div class="extraForm" style="display:none;"&gt;
                                        &lt;!--extra form elements and submit button here--&gt;
                                    &lt;/div&gt;
</code></pre>

<p>Oh and would idealy like form to have dynamic action based on event handler, so if standard form submit.. do something, if checkbox selected , form submit ... do something else</p>

<p>Also looking to change form action based on CHECKBOX selection ?</p>

<p>so something like ... </p>

<p>changeAction(url) {
    document.this_form.action = "clicked.php";
}</p>

<p>&lt; form method="POST" name="this_form" action="unclicked.php">

</p>
