i have created a check box dynamicaly want to validate the checkbox before submiting form
<p>A checkbox will be created according to the query. I want to validate the checkbox before submitting the form.</p>

<p>I have used that check all and uncheck all using javascript so I used the attribute <code>id</code> in an array:</p>

<pre><code> &lt;input type="checkbox" name="playlist[]" id="playlist" value="&lt;?php echo $filmpath; ?&gt;"/&gt;
</code></pre>

<p>I used the validation code as</p>

<pre><code> //enter code here
 function chkvalidate()
 {
   //enter code here
   if ( document.modifyform.playlist.checked == false )
   {
     //enter code here
     alert( "Please check the Terms &amp; Conditions box." );
     //enter code here
     valid = false;
     //enter code here
   }
 }
</code></pre>

<p>This code is not working.</p>
