title: Issues with javascript validation of radio buttons on php form
body: <p>This is the code for the php file containing the form with radio buttons:</p>
  
  <pre><code>&lt;?php
      while($r7 = mysql_fetch_array($rt3)){
          $name=$r7["name"];  
          $s=$r7["question"]; 
  
          echo "
          &lt;div&gt;$s&lt;/div&gt;
  
          &lt;form name='Tester' method='post' onSubmit='return RegValidate(this);' action='quest.php' &gt;
          &lt;input type='radio' name='w1' value='1'&gt;1&lt;br&gt;
          &lt;input type='radio' name='w1' value='2'&gt;2&lt;br&gt;
          &lt;input type='radio' name='w1' value='3'&gt;3&lt;br&gt;
  
  
  
          ";
          }
          echo" &lt;input  name='Submit' value='Tester' type='submit' /&gt;
          &lt;/form&gt;";
  
  ?&gt;
  </code></pre>
  
  <p>The $name and $q are derived from the database using a mysql query. This works fine.
  I have used the following javascript code so far:</p>
  
  <pre><code>function RegValidate(Tester) 
   {
  
   if($('#w1').not(':checked'))
  {
     alert('Radio not checked');
     return false;
  }
  
  }
  </code></pre>
  
  <p>But with this code, I continue to get the error message, and I am not able to move on even though I have selected a radio button.</p>
  
  <p>The while loop produces several sets of radio buttons, as $q, gets the question from the database and posts it on the page along with 3 radio buttons. Each question $q, has the 3 radio buttons in the above, hence the reason for the $name.</p>
  
  <p>How do I validate this form with javascript. NB. The form will only contain radio buttons.</p>