Problem preventing form submission

Problem preventing form submission

I have a very simple script that checks to see if any fields with the class of 'require' are empty. If any of them are, then I want the script to prevent form submission.

Here is what I currently have:
  1. // prevent form submission if required fields are empty
  2. $(document).ready(function() {
  3.     $('#frm-contact').submit(function() {
  4.         if ($('#frm-contact .require').val() == '') {
  5.             alert('Please make sure that all of the fields marked with a * are filled in.');
  6.             return false;
  7.         }
  8.     })
  9. })
But if only one of the fields has a value then that is enough for the form to be submitted. I need it so that all of the required fields need a value inside them.

Here is an older script I made, but I just can't seem to stop the form from submitting!!
  1. // prevent form submission if required fields are empty
  2. $(document).ready(function() {
  3.     $('#frm-contact').submit(function() {
  4.         $('.require').each(function() {
  5.             if ($(this).val() == '') {
  6.                 alert('Please make sure that all of the fields marked with a * are filled in.');
  7.                 var returnCheck = 0;
  8.             }
  9.         })
  10.         if (returnCheck == 0) {
  11.             return false;
  12.         }
  13.     })
  14. })
If anyone has any ideas that would be great :D