I try to prevent a form submitting, with the following script, but it always does. I have even tried preventDefault() on document load, but it does not work.
$("form").submit(function() {
      if ($("input").eq(3).val() == $("input").eq(4).val()) {
            $("span").text("Validated...").show();
        return true;
      }
      $("span").text("Passwords do not match!").show().fadeOut(1000);
      return false;
});
 
     
     
     
    