Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript Checkbox Validation stuck with Value of multiple checkbox
    text
    copied!<p>I have an problem with my checkbox submit. I know when we want to submit multiple value checkbox we must put inside name like : ccd_pos[]. But now its not function, because I have an javascript validation that the function is enabled checkbox 2,3,4 after checkbox 1 checked. You can see my code so far below :</p> <p>Javascript Code</p> <pre><code>if (theForm.ccd_chk.checked) { theForm.ccd_pos [0].className = 'part'; theForm.ccd_pos [1].className = 'part'; theForm.ccd_pos [2].className = 'part'; theForm.ccd_pos [0].disabled = false; theForm.ccd_pos [0].checked = false; theForm.ccd_pos [1].disabled = false; theForm.ccd_pos [1].checked = false; theForm.ccd_pos [2].disabled = false; theForm.ccd_pos [2].checked = false; } else { theForm.ccd_pos [0].disabled = true; theForm.ccd_pos [1].disabled = true; theForm.ccd_pos [2].disabled = true; } </code></pre> <p>HTML checkbox</p> <pre><code>&lt;input type="checkbox" name="ccd_chk" value="yes" class="part" onclick="ActionCcdCheck (this.form);" onkeypress="FocusChange (this.form, 5, 4);"/&gt; &lt;input type="checkbox" name="ccd_pos" value="front" class="part" onkeypress="FocusChange (this.form, 6, 3);"/&gt; Front &lt;input type="checkbox" name="ccd_pos" value="back" class="part" onkeypress="FocusChange (this.form, 7, 2);"/&gt; Back &lt;input type="checkbox" name="ccd_pos" value="fb" class="part" onkeypress="FocusChange (this.form, 8, 1);"/&gt; FB </code></pre> <p>So now my question is how to make the checkbox keep function and value of checkbox can be combine when I submit that.</p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload