Trying to validate that a radio button was selected
<p>I've looked several places and can't find an example that works. In my example I select the radio group and test for null so I can issue a message telling the user to make a selection.</p>

<pre><code>&lt;script&gt;                        
function validate(form) {   
    fail = validate__veteran(form);
    if (fail == "") { 
        return true;
        } else { 
            alert(fail);
            return false;
        }
    }
&lt;/script&gt;
&lt;script&gt; 

    function validate_veteran(form) {
        var radios = document.getElementsById('veteran');
        if (radios == null) {
            return "please make a selection for veteran";
        }
        return "";
    }
&lt;/script&gt;
&lt;form method="post" action="checkbox.php" onSubmit="return validate(this)"&gt;
        Veteran?&lt;**input type="radio" id="veteran"** name="veteran" value="veteran" /&gt; yes &lt;br&gt;
                &lt;input type="radio" id="veteran" name="veteran" value="" /&gt; no &lt;br&gt;
&lt;input id="submit" type="submit" name="submit" value="Signup" /&gt;                        
&lt;/form&gt;
</code></pre>
