title: Select Box Trigger Events in Javascript
body: <p>I have javascript creating a generic select box when you double click in a table cell and when an option is clicked, the select box is removed and the option selected is recorded. The table cell displays the option selected. </p>
  
  <p>However, if the table cell is double clicked and the select box is created, but then you just click out of the select box without selecting an option, the select box remains and the rest of the page from then on breaks. </p>
  
  <p>I want the select box to be removed if the focus is lost, but the onblur method that works with input boxes doesn't seem to work with select boxes. </p>
  
  <p>Does anyone know what event is triggered? </p>
  
  <p>Javascript code when table cell is double clicked to make a select box:</p>
  
  <pre><code>var object_input = document.createElement ("SELECT");   //Put an select box in the cell
  
  object_input.setAttribute("name", "course_price_select");
  object_input.setAttribute("id", "course_price_select");
  object_input.style.width = (current_cell.clientWidth - 20) + "px";
  
  object_input.attachEvent ("onblur", focus_lost);  
  object_input.attachEvent ("onkeypress", checkForEnter);
  </code></pre>
  
  <p>These two lines don't work! (focus_lost and checkForEnter methods start with alert('hi'); so I know they are not being triggered)</p>
  
  <pre><code>object_input.onchange = function() {focus_lost()};
  
  //Populate with options....
  </code></pre>