prevent submit button from redirecting if jquery validation occurs
<p>I have a form which has jquery validation. I also have submit button which redirects to page.html when it is clicked. So when I click submit if the value of dropdown is 'please select' the validation appears however it then redirects to page.html. How do I prevent it from doing this? The code for my jquery:</p>

<pre><code>&lt;script&gt;      
    $( function(){    
            function validate(id){       
                var enabled = ($("input[name='attendance" + id + "']:checked").val() == 'Yes');         
                if(enabled){              
                    //Please select option is selected              
                    if($("#colour" + id)[0].selectedIndex == 0){                 
                    alert('Please select color');                  
                    return false;             
                    }              
                    //Please select option is selected              
                    if($("#shade" + id)[0].selectedIndex == 0){                  
                        alert('Please select shade');                  
                        return false;             
                    }   
                }     
                return true;    
            };

            $("input[name^='attendance']").click(function() {  

                var id = this.name.replace('attendance', '');      
                $("#colour" + id + ", #shade" + id).prop("disabled", this.value == 'No');         
                validate(id);    
            });      
           $("input:submit").click(function(){         
               var retVal = false;
               $.each([1, 2], function(i, val){
                  retVal = (validate(val) || retVal);
               });
                return retVal;   
           }); 
         }); 
  &lt;/script&gt;
</code></pre>
