title: how to set values to combobox dynamically in javascript
body: <p>this is how i set value to a combobox using dwr call,</p>
  
  <p><code>var reportID = '&lt;%=reportid%&gt;';
      var reportName = '&lt;%=reportname%&gt;';
      loadReportNames(reportUserID);</code></p>
  
  <pre><code>function loadReportNames(reportUserID){
      CustomiseReportAction.getReportNames(reportUserID, addReportNamesDropDown);
  }
  function addReportNamesDropDown(resultMap){
      dwr.util.removeAllOptions("reportnames");
      dwr.util.addOptions("reportnames",resultMap);
  }
  </code></pre>
  
  <p>after loading the combo box i set values to loaded combo like this,</p>
  
  <pre><code>document.getElementById("reportnames").value=reportID;
  </code></pre>
  
  <p>but the reportID is not set,</p>
  
  <p>what could be the problem please help me to resolve this.</p>
  
  <pre><code>UPDATE :
  
  function addCombo() {
      var reportID = '&lt;%=reportid%&gt;';
      var reportName = '&lt;%=reportname%&gt;';
      var textb = document.getElementById("reportnames");
  
      var option = document.createElement("option");
      option.text = reportName;
      option.value = reportID;
      option.selected="selected";
      try {
          textb.add(option, null); //Standard
      }catch(error) {
          textb.add(option); // IE only
      }
      textb.value = "";
  }
  </code></pre>
  
  <p>used above method it gives me no exception but no results.</p>
  
  <p>Regards</p>