title: javascript undefined input value despite of writing in it
body: <p>I have a strange problem: I am getting a undefined alert window by running this code. I looked up all the entrys here but I couldn't find a solution.</p>
  
  <ul>
  <li>I've checked, there is no identical id except this one</li>
  <li>running the php file the result of <code>var_dump($user_id)</code> shows the right value</li>
  <li>this is why I don't understand why the value in javascript is undefined all the time...</li>
  </ul>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;form action="?atn=surveyCode" method="post" class="form mg_top"&gt;
  
    &lt;label id="entersID" for="usersID"&gt;Enter your prolific ID:&lt;/label&gt;
    &lt;input id="usersID" value="" type='text' class="form-control talign_center input" name="usersID"&gt;
  
    &lt;button id="survey" class="btn btn-primary form-control"&gt;Go to questions&lt;/button&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>JavaScript:</strong> every alert is returning "undefined". I never get in the else part. This is really strange. I've many parts like this in my code and they are working perfectly.</p>
  
  <pre><code>$("#survey").click(function(e){
  
      var prolific = $("usersID").val();
      alert(prolific);
  
      if(prolific==undefined){
          alert(prolific);
  
          $("#entersID").addClass("error-msg");
          $("#entersID").parent().addClass("has-error");
          e.preventDefault();
      }
      else{
          alert(prolific);
  
          window.open("http://www.w3schools.com");
      }
  
  });
  </code></pre>
  
  <p><strong>PHP:</strong></p>
  
  <pre><code>private function surveyCode(){
      $userID = $_POST["usersID"];
      var_dump($userID); //shows a value
  }
  </code></pre>
  
  <p>Please help me, maybe this is a silly bug but I can't find it....</p>