Can you please help me modify this JavaScript?
<p>The following code works great in terms of enforcing validation rules.</p>

<pre><code>function validate() {

    if (document.getElementById("&lt;%=txtName.ClientID%&gt;").value == "") {
        alert("Please enter name");
        document.getElementById("&lt;%=txtName.ClientID%&gt;").focus();
        return false;
    }

    if (document.getElementById("&lt;%=txtCity.ClientID %&gt;").value == "") {
        alert("Please enter city");
        document.getElementById("&lt;%=txtCity.ClientID %&gt;").focus();
        return false;
    }
    if (document.getElementById("&lt;%=txtState.ClientID%&gt;").value == "") {
        alert("Please enter state");
        document.getElementById("&lt;%=txtState.ClientID%&gt;").focus();
        return false;
    }
    if (document.getElementById("&lt;%=txtZip.ClientID%&gt;").value == "") {
        alert("Please enter zip");
        document.getElementById("&lt;%=txtZip.ClientID%&gt;").focus();
        return false;
    }
    if (checkradio() == false) {
        alert("Please enter contacts");
        document.getElementById("&lt;%=txtContacts.ClientID%&gt;").focus();
        return false;
    }
     return true;
}
</code></pre>

<p>My issue is that the form is broken into 2 sections, section 1 and section 2.</p>

<p>Second 1 contains required form fields and section 2 contains option field. </p>

<p>The rule is that you cannot select from both sections at same time. You can either select from section 1 OR section 2.</p>

<p>Section 1 has above form fields that are required and section 2 ahas form fields on the same form that are optional.</p>

<p>If I select from section 1, everything is fine.</p>

<p>If I selection from section 2, since they are on the same form, the validation rules kick in.</p>

<p>Is there a way to condition the form to say, if form fields from section 2 are NOT blank, then no validation rules are in effect?</p>

<p>Better yet, in classic asp, you can have multiple forms in one file.</p>

<p>Is that possible in asp.net?</p>

<p>I think this will eliminate the validation from kicking in when selecting from optional fields.</p>

<p>Sorry for long thread.</p>
