Zablokowanie formularza js/jquery

<!-- javascript -->
<script>
  window.onload=function() {
    document.getElementById('form_name').addEventListener('submit', function (e) {
      alert('submit intercepted');
      e.preventDefault(e);
    });
  };
</script>

<!-- jquery -->
<script>
  $(document).ready(function() {
    $('#form_name').on("submit",function(e) {
      alert('submit intercepted');
      e.preventDefault(e);
    });
  });
</script>
Komentarze wyłączone