form validation for a changing form name
<p>I have a arrary of forms that is created dynamically using php.</p>

<p>The form name is created using a php $formcount variable and incremented using a while loop. So for multiple forms created, the form name will be: 
update1
update2
update3 and so on.</p>

<p>I have a dropdown menu in each form which needs to be validated. I am not able to use JavaScript successfully to validate each form seperately as the name of the form keeps changing everytime.</p>

<pre><code>$formcount=0;
while($info=mysql_fetch_array($agent_q))
{
......
echo('
&lt;form name="update'.$formcount.'" method="post" onsubmit="return CheckUpdate(this);"&gt;
&lt;select name="login_time" id="login_time"&gt;
&lt;option value="none"&gt;Select Login&lt;/option&gt;
&lt;option value="00:30"&gt;00:30&lt;/option&gt;
&lt;option value="02:30"&gt;02:30&lt;/option&gt;
&lt;option value="03:30"&gt;03:30&lt;/option&gt;
&lt;option value="04:30"&gt;04:30&lt;/option&gt;
&lt;option value="06:30"&gt;06:30&lt;/option&gt;
&lt;option value="09:30"&gt;09:30&lt;/option&gt;
&lt;option value="12:30"&gt;12:30&lt;/option&gt;
&lt;option value="13:30"&gt;13:30&lt;/option&gt;
&lt;option value="16:30"&gt;16:30&lt;/option&gt;
&lt;option value="17:30"&gt;17:30&lt;/option&gt;
&lt;option value="18:30"&gt;18:30&lt;/option&gt;
&lt;option value="19:30"&gt;19:30&lt;/option&gt;
&lt;option value="20:30"&gt;20:30&lt;/option&gt;
&lt;option value="21:30"&gt;21:30&lt;/option&gt;
&lt;option value="22:30"&gt;22:30&lt;/option&gt;
&lt;/select&gt;&lt;/form&gt;');
.....
}
</code></pre>

<p>my JS is </p>

<pre><code>function CheckUpdate(){
    if(document.????==0){
    alert("Select Login Time!\r\n");
    return false;
    }
    else
    return true;
}
</code></pre>

<p>not sure what to put in place of ???. I am sure this is something rather easy.. any help is highly appreciated. Thank you!</p>
