title: how to validate radio buttons and drop down list using java script?
body: <p>i have field gender in the form. if user doesn't select the radio button, i must show a message "please select your gender".
  also the user must select age group..</p>
  
  <p><strong>Form:</strong></p>
  
  <pre><code>&lt;label&gt;Gender&lt;br /&gt;
  &lt;/label&gt;
  &lt;label&gt;Male&lt;/label&gt;&lt;input id="male" type="radio" name="gender" class="box" style="border:solid 3px #333333" value="male" /&gt;
  &lt;label&gt;female&lt;/label&gt;&lt;input id="female" type="radio" name="gender" value="female"&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;label&gt;Age &lt;/label&gt;
  &lt;select name="age"&gt;
  &lt;option&gt;Select&lt;/option&gt;
    &lt;option value="Below 16"&gt;Below 16/option&gt;
    &lt;option value="16-20"&gt;16-20&lt;/option&gt;
    &lt;option value="21-25"&gt;21-25&lt;/option&gt;
    &lt;option value="26-30"&gt;26-30&lt;/option&gt;
    &lt;option value="31-35"&gt;31-35&lt;/option&gt;
    &lt;option value="Above 35"&gt;Above 35&lt;/option&gt;
  &lt;/select&gt;
  &lt;input type="submit" value=" Register " style="border:solid 2px #333333"/&gt;
  </code></pre>
  
  <p><strong>Java Script</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function validateForm()
  {
  if (document.getElementById("male").checked=false &amp;&amp; document.getElementById("female").checked=false)
  {
       alert("Please select Gender");
    return false;
  }
  }
  </code></pre>
  
  <p>user must select gender and age.. otherwise he is not allowed to register. how to do it?</p>