title: How to create Editable Dropdown List with Dictionary Option using JavaScript?
body: <p>Eg:-- When I type "A" all the elements starting with A should be displayed... If "B" then elements with B....etc)</p>
  
  <p>Ex:    </p>
  
  <pre><code>    &lt;asp:DropDownList ID="ddlLocation" style="width:140px" runat="server"&gt;
  
      &lt;asp:ListItem Value="1" &gt;India&lt;/asp:ListItem&gt;
      &lt;asp:ListItem Value="2" &gt;India - Hyderabad&lt;/asp:ListItem&gt;
      &lt;asp:ListItem Value="3"&gt;South Africa&lt;/asp:ListItem&gt;
      &lt;asp:ListItem Value="4"&gt;Australia&lt;/asp:ListItem&gt;       
  
      &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>javascript : </p>
  
  <pre><code>function DisplayText()
  {
   var textboxId = '&lt;% = txtText.ClientID %&gt;'; 
      var dropdownListId = '&lt;% = ddlLocation.ClientID %&gt;'; 
      document.getElementById(textboxId).value = document.getElementById(dropdownListId).value; 
      document.getElementById(textboxId).focus(); 
  }
  </code></pre>
  
  <p>code behind : </p>
  
  <pre><code>ddlLocation.Attributes.Add("onChange", "DisplayText();");
  </code></pre>
  
  <p>Regards
  ravi,</p>