Form keeps ignoring the preventDefault JS event.

Hello experts:
My form keeps ignoring the preventDefault JS event.
I built an html form with JS backend connected. The form is supposed to write to a Firebase db. The db is already active and works with an Android app. Permissions for testing are set to true for write and read.
I built the JS file incrementally testing code with the console log along the way. It worked perfectly till the Firebase script was added. Now it ignores the event to preventDefault.
The console lists no exceptions.
The site is
I have looked and looked at this till my eyes are falling out of my head. Can you spot what I'm missing?

<!DOCTYPE html>
<html lang="en">
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Acme Web Design</title>
  <link href="" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
  <link rel="stylesheet" href="" />
  <link rel="stylesheet" href="style.css">
  <div class="container">
    <h1 class="brand"><span>Acme</span> Web Design</h1>
    <div class="wrapper">
      <div class="company-info">
        <h3>Acme Web Design</h3>
          <li><i class="fa fa-road"></i> 44 Something st</li>
          <li><i class="fa fa-phone"></i> (555) 555-5555</li>
          <li><i class="fa fa-envelope"></i> test@acme.test</li>
      <div class="contact">
        <h3>Email Us</h3>
        <div class="alert">Your message has been sent</div>
        <form id="contactForm">
            <input type="text" name="name" id="name" >
            <input type="text" name="company" id="company">
            <label>Email Address</label>
            <input type="email" name="email" id="email" >
            <label>Phone Number</label>
            <input type="text" name="phone" id="phone">
          <p class="full">
            <textarea name="message" rows="5" id="message"></textarea>
          <p class="full">
            <button type="submit">Submit</button>
    // Initialize Firebase
    var config = {
      apiKey: "************",
      authDomain: "*********",
      databaseURL: "************",
      projectId: "*********",
      storageBucket: "**********",
      messagingSenderId: "*********"
    <!-- firebase.initializeApp(config);-->
  <script src=""></script>
  <script src=""</script>
  <script src="main.js"></script>

Open in new window

The JS code:
  // Create Reference Collection
  var testvaluesRef = firebase.database().ref('testvalues');

// Listen for form submit
document.getElementById('contactForm').addEventListener('submit', submitForm);

// Submit form
function submitForm(e){


 // Get values
  var name = getInputVal('name');
  var email = getInputVal('email');
  var phone = getInputVal('phone');
  var allvalues = name + ", " + email + ", " + phone;

  // Save values to Firebase
 saveTestValues(name, email, phone);

// Function to get get form values
function getInputVal(id){
  return document.getElementById(id).value;

// Save values to firebase
function saveTestValues(name, email, phone){
  var newtestvaluesRef = testvaluesRef.push();
    name: name,

Open in new window

Robert BellowsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

One of those things that will really irritate you....
You're missing an end tag around the second firebase script.  So your main.js is never actually loading.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Robert BellowsAuthor Commented:
Thanks. I can't believe how many times I looked at that and missed it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.