Javascript Loop through Validation Form
<p>I need help creating a javascript loop for an object that I am validating.  The validation works, it displays the alert, but it does not focus on the field.  The reason it will not focus on the field is because that field's id is unique each time the user adds another account.  The code is below:</p>

<pre><code>if ((theForm.LinkedAccts.value == "Yes")&amp;&amp;
    (document.getElementById('DLAccount').selectedIndex == ""))
{
     alert("Please enter the Delink Account number.");
     document.getElementById('DLAccount').focus();
     return (false);
}
</code></pre>

<p>Thanks!</p>
