This is the code for the php file containing the form with radio buttons:
<?php
    while($r7 = mysql_fetch_array($rt3)){
        $name=$r7["name"];  
        $s=$r7["question"]; 
        echo "
        <div>$s</div>
        <form name='Tester' method='post' onSubmit='return RegValidate(this);' action='quest.php' >
        <input type='radio' name='w1' value='1'>1<br>
        <input type='radio' name='w1' value='2'>2<br>
        <input type='radio' name='w1' value='3'>3<br>
        ";
        }
        echo" <input  name='Submit' value='Tester' type='submit' />
        </form>";
?>
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:
function RegValidate(Tester) 
 {
 if($('#w1').not(':checked'))
{
   alert('Radio not checked');
   return false;
}
}
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.
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.
How do I validate this form with javascript. NB. The form will only contain radio buttons.
 
     
     
     
    