title: java.lang.NumberFormatException: null - cannot read input type
body: <p>I'm trying to DELETE some data from SQL when a button is clicked. However, I keep getting the error java.lang.NumberFormatException: null when the button is clicked. This confusses me because I can display the ID in my jsp.file, so i know the value is selected and displayed. </p>
  
  <p>Here is my jsp file: </p>
  
  <pre><code>if (request.getParameter("delete") != null){
   long betID = Long.parseLong(request.getParameter("id"));
   System.out.print(betID);
  }
  
  &lt;form action="newBet.jsp" method="get"&gt;
      &lt;fieldset&gt;
          &lt;input class="btn btn-default" type="submit" name="w" value="Vundet"/&gt; 
          &lt;input class="btn btn-default" type="submit" name="L" value="Tabt" /&gt; 
          &lt;input type="submit" name="id" value="&lt;%=bet.getId()%&gt;"/&gt;
      &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This successfully shows the value bet.getId() in my jsp file. I will ofc change type to "hidden" when I'm done. 
  The problem is when I click the button "delete" it does not ready my value. </p>
  
  <p>Here is my Java:</p>
  
  <pre><code>public static void removeBet(long betID) throws SQLException {
  
   Connection connection = null;   
  
      try { 
  
          DB_Connection connect = new DB_Connection();
          connection=connect.get_Connection();
  
          String sql = "DELETE FROM bets WHERE id = ?";
          PreparedStatement ps = connection.prepareStatement(sql);
  
          ps.setLong(1, betID);
          ps.executeUpdate();
  
        }catch (SQLException e) {
          e.printStackTrace();
      } finally {
          connection.close();
      }
  </code></pre>
  
  <p>The value of my betID is set to long everywhere in my code. I hope some of you might be able to help me. I've checked similar questions, but unfortunatly I've not been able to solve the issues. Thank you.</p>