Strange behavior of javascript &&
<p>I am using below method for validating that one of radio button must be selected.</p>

<pre><code>function validateForm(){
    var searchType = document.getElementsByName("form1:searchType");
    var a = !(searchType[0].checked);
    var b = !(searchType[1].checked);
    if(a&amp;&amp;b){
        alert('Please select search type');
        return false;
    }
    return true;
}
</code></pre>

<p>In above method searchType is radio button which is creating two buttons. It works fine that is shows alert message if none of the two radio buttons are selected but it show alert message even when second of the radio button is selected. Any idea please? </p>
