execute code which does the validation on submit button click - jquery
<p>I have a submit buttons which sends the info to MySQL. If the submit button is clicked when the radio button is 'yes' and the drop down value is 'please select' I want the validation error to pop up. Currently it pops up when 'yes' radio button Is selected. </p>

<pre><code>$( function(){
    $("input[name='discount']").click(function() {
        var isDisabled = (this.value == 'No');
        $("#colour1, #shade1").prop("disabled", isDisabled);

        if(!isDisabled){
             //Please select option is selected
             if($("#colour1")[0].selectedIndex == 0){
                 alert('Please select color');
             }
             //Please select option is selected
             if($("#shade11")[0].selectedIndex == 0){
                 alert('Please select shade');
             }
        }

    });
});
</code></pre>
