How to fix this Javascript Form Validation script?
<p>I am using the following javascript for form validation:</p>

<pre><code>&lt;script type="text/javascript"&gt;
function validate_form ( )
{
    valid = true;

        if ( document.contact_form.contact_name.value == "" )
        {
                alert ( "Please fill in the 'Your Name' box." );
                valid = false;
        }

        if ( ( document.contact_form.gender[0].checked == false ) &amp;&amp; ( document.contact_form.gender[1].checked == false ) )
        {
                alert ( "Please choose your Gender: Male or Female" );
                valid = false;
        }

        if ( document.contact_form.age.selectedIndex == 0 )
        {
                alert ( "Please select your Age." );
                valid = false;
        }

        if ( document.contact_form.terms.checked == false )
        {
                alert ( "Please check the Terms &amp; Conditions box." );
                valid = false;
        }

        return valid;
}
&lt;/script&gt;
</code></pre>

<p>The form:</p>

<pre><code>&lt;form name="contact_form" method="post" action="somepage.php" onSubmit="return validate_form();"&gt;

&lt;h1&gt;Please Enter Your Details Below&lt;/h1&gt;

&lt;p&gt;Your Name: &lt;input type="text" name="contact_name"&gt;&lt;/p&gt;

&lt;p&gt;Your Gender: &lt;input type="radio" name="gender" value="Male"&gt; Male
&amp;nbsp; &lt;input type="radio" name="gender" value="Female"&gt; Female&lt;/p&gt;

&lt;p&gt;Your Age:

&lt;select name="age"&gt;
    &lt;option value=""&gt;Please Select an Option:&lt;/option&gt;
    &lt;option value="0-18 years"&gt;0-18 years&lt;/option&gt;
    &lt;option value="18-30 years"&gt;18-30 years&lt;/option&gt;
    &lt;option value="30-45 years"&gt;30-45 years&lt;/option&gt;
    &lt;option value="45-60 years"&gt;45-60 years&lt;/option&gt;
    &lt;option value="60+ years"&gt;60+ years&lt;/option&gt;
&lt;/select&gt;

&lt;p&gt;Do you agree to the Terms and Conditions?
&lt;input type="checkbox" name="terms" value="Yes"&gt; Yes

&lt;p&gt;&lt;input type="submit" name="send" value="Send Details"&gt;&lt;/p&gt;

&lt;/form&gt;
</code></pre>

<p>The validation works fine, except it displays one alert box after another to point out which fields haven't been filled in or selected.</p>

<p>How can this script be modified so that all the missing fields are pointed out in <strong>ONE</strong> alert box like:</p>

<blockquote>
  <p>Please fill in the following fields:
  Name, Gender, Age, Terms and
  Conditions</p>
</blockquote>
