title: Why textbox prevent div to be closed?
body: <p>I have a page with a food table, and when I want to add a new food, I have a button of "insert food", which when clicked shows a small div with labels, text-boxes and stuff for insertion, and it changes its text from "insert" to "cancel". Here is the code:</p>
  
  <pre><code> protected void insertFoodBTN_Click(object sender, EventArgs e)
  {
      if (insertFoodBTN.Text == "Insert Food")
      {
          nameF.Visible = true;
          nameFTB.Visible = true;
          priceF.Visible = true;
          priceFTB.Visible = true;
          ... etc ...
          addFBTN.Visible = true;
          insertDiv.Style["display"] = "block";
          insertFoodBTN.Text = "Cancel Insertion";
      }
      else
      {
          nameF.Visible = false;
          nameFTB.Visible = false;
          priceF.Visible = false;
          priceFTB.Visible = false;
          ... etc ...
          addFBTN.Visible = false;
          insertDiv.Style["display"] = "none";
          insertFoodBTN.Text = "Insert Food";
      }
  }
  </code></pre>
  
  <p><strong>That works fine</strong>
  My problem is that when I want to close it back by clicking the same "insert food" button it doesn't even enter the function of that insertButton_Clicked.
  Notice - its text is "cancel insertion", but the ID hasn't been changed so it should basically enter.</p>
  
  <p>After enquiring - it turns that the two first text boxes cause that, because when I deleted them the Insert div was gone again, as before.
  I don't know why, because I have another text box after them which doesn't prevent hiding the div back.</p>
  
  <p>I don't have a clue why is that. Thanks for helping.</p>
  
  <p>[after clicking "Insert food" for the first time, and the div opens][1]</p>