Validate unknown number of textfields using JavaScript
<p>I have defined text fields as follows:</p>

<pre><code>&lt;form name="form1" method="post" action="save_banners.php" onsubmit="return check_form();"&gt;
&lt;input type=text name=banner[]&gt;
&lt;input type=text name=banner[]&gt;
&lt;input type=text name=banner[]&gt;
&lt;input type=text name=banner[]&gt;
&lt;input type=submit value="submit"&gt;

&lt;script&gt;
function check_form(){
alert (document.form1.banner[0].value);
}
&lt;/script&gt;
</code></pre>

<p>How to access these fields in JavaScript? I am using the above JavaScript code, but it's not working.</p>

<p>Regards,</p>
