submit if check passes

submit if check passes

I'm probably not writing this the proper way, but I have code that almost works.  


  1. $("#submit_button").click(function(){
  2. $(".product").each(function(){
  3. if ($(this).val() == '' ) {
  4. $("#product_failed").css("display", "inline");
  5. $("#myForm").submit(function(){
  6. return false;
  7. });//end submit false
  8. }else{
  9. $("#product_failed").css("display", "none");
  10. $("#myForm").submit();
  11. };//end if
  12. });//end .product each function
  13. });//end submit button click

The error message shows and hides properly based on whether the select menu value is "" or not, but if the value is not "" the form doesn't submit.  Any help with context would be greatly appreciated.

Thanks in advance,
Twitch