A dropdown validation error occurs if no value is selected on the associated radio button
<p>I have a form with two radio buttons: "Yes" and "No". If "Yes" is selected, the user selects what they want from two drop-down menus. If the user selects "No", the form's JavaScript will grey out both drop-down menus.</p>

<p>My jQuery code is shown below. I added:</p>

<pre><code>if(!$("#discount").prop("disabled") &amp;&amp; $("#colour1, #shade1").val() == 'please select'){
    //alert('Please select');
}
</code></pre>

<p>but it did not work.</p>

<p>Both radio buttons' <code>name</code> attribute is set to <code>discount</code>. The drop-down menus' <code>id</code> attributes are <code>#colour1</code> and <code>#shade1</code>.</p>

<p>The first value of each drop down is "please select":</p>

<pre><code> $( function(){
        $("input[name='discount']").click(function() {
            $("#colour1, #shade1")
            .prop("disabled", this.value == 'No');
            if(!$("#discount").prop("disabled") &amp;&amp; $("#colour1, #shade1").val() == 'please select'){ //alert('Please select'); }. 
        }).click();

    });
</code></pre>
