title: Can't get my if statement to work with html form input in js
body: <p>Without my if statement I'm able to store the data but when i want to check against an html form value, Im unable to do so.
  P.S I'm fairly new to js so please bear with me.   </p>
  
  <pre><code>&lt;script&gt;
  var signupForm = document.getElementById('signup-form');
  var signupSuccess = document.getElementById('signup-success');
  var signupError = document.getElementById('signup-error');
  var signupBtn = document.getElementById('signup-button');
  var day_Imp = document.getElementById('D-day').value;
  var onSignupComplete = function(error) {
    signupBtn.disabled = false;
    if (error) {
      signupError.innerHTML = 'Sorry. Your Booking failed.';
    } else {
      signupSuccess.innerHTML = 'Thanks for playing at Total Football!';
      // hide the form
      signupForm.style.display = 'none';
    }
  };
  
  function signup(formObj) {
      console.log(day_Imp);
      // Store emails to firebase
      if(day_Imp==='monday'){
          var myFirebaseRef = new Firebase("https://fiery-torch-164.firebaseio.com/days/monday");
          myFirebaseRef.push({
            email: formObj.email.value,
            name: formObj.name.value,
            number: formObj.number.value,
          }, onSignupComplete);
          signupBtn.disabled = true;
          return false;
      }
  }
  </code></pre>
  
  <p></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script src="https://cdn.firebase.com/js/client/1.0.18/firebase.js"&gt;&lt;/script&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" type="text/css" href="infoCSS.css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class="signup"&gt;
      &lt;h2 class="signup-title"&gt;Enter your information please&lt;/h2&gt;
      &lt;p id="signup-success" class="text-success"&gt;&lt;/p&gt;
      &lt;p id="signup-error" class="text-danger"&gt;&lt;/p&gt;
      &lt;form class="signup-form form-inline" id="signup-form" role="form" onsubmit="return signup(this)"&gt;
          &lt;label&gt;Full Name&lt;/label&gt;&lt;br&gt;&lt;br&gt;
          &lt;input class="form-control" name="name" type="text" required&gt;&lt;br&gt;&lt;br&gt;
          &lt;label&gt;Email&lt;/label&gt;&lt;br&gt;&lt;br&gt;
          &lt;input class="form-control" name="email" type="email" placeholder="Your email. eg., joe@acme.com" required&gt;&lt;br&gt;&lt;br&gt;
          &lt;label&gt;Cell Phone&lt;/label&gt;&lt;br&gt;&lt;br&gt;
          &lt;input class="form-control" name="number" type="tel" required&gt;&lt;br&gt;&lt;br&gt;
          &lt;label&gt;Day&lt;/label&gt;&lt;br&gt;&lt;br&gt;
          &lt;input type="text" id="D-day"&gt;&lt;br&gt;&lt;br&gt;
          &lt;button class="btn btn-success" id="signup-button" type="submit" &gt;#Allin!&lt;/button&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
      var signupForm = document.getElementById('signup-form');
      var signupSuccess = document.getElementById('signup-success');
      var signupError = document.getElementById('signup-error');
      var signupBtn = document.getElementById('signup-button');
    //  var day_Imp = document.getElementById('D-day');
      var onSignupComplete = function(error) {
        signupBtn.disabled = false;
        if (error) {
          signupError.innerHTML = 'Sorry. Your Booking failed.';
        } else {
          signupSuccess.innerHTML = 'Thanks for playing at Total Football!';
          // hide the form
          signupForm.style.display = 'none';
        }
      };
      
      function signup(formObj) {
  
    // Store emails to firebase
    $('#D-day').on('input', function() {
      var day_Imp = document.getElementById('D-day').value;
      console.log(day_Imp);
  
      if (day_Imp == 'monday') {
        var myFirebaseRef = new Firebase("https://fiery-torch-164.firebaseio.com/days/monday");
        myFirebaseRef.push({
          email: formObj.email.value,
          name: formObj.name.value,
          number: formObj.number.value,
        }, onSignupComplete);
        signupBtn.disabled = true;
        return false;
      }
    });
  }
  &lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here is the updated version including all the html and js. </p>