I have this field select:
<div class="control-group">
<select runat="server" onclick="ClearOptions(this);" name="txtpesquisa" id="txtpesquisa" class="form-control.selectize-control">
</select>
<script>
$('#txtpesquisa').selectize();
</script>
</div>
I need to clean it by clicking, where it opens the search, because it is written search here, then when it clicked, I needed the field ready to be typed. How can I do it? I have tried some forms, but to no avail. This is the last form I tried, but it did not work either:
function ClearOptions(id) {
document.getElementById(id).options.length = -1;
}
Here's how I load the search.
private void CarregaPessoa() {
SqlCommand comando = new SqlCommand();
comando.Connection = clsdb.AbreBanco();
comando.CommandType = CommandType.Text;
comando.CommandText = "select id, nome, classificacao_id from PESSOA where id != 0 order by nome asc";
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = comando;
DataSet ds = new DataSet();
da.Fill(ds);
DataRow dr = ds.Tables[0].NewRow();
dr[0] = 0;
dr[1] = "Pesquise aqui .. ";
ds.Tables[0].Rows.InsertAt(dr, 0);
txtpesquisa.DataSource = ds.Tables[0];
txtpesquisa.DataTextField = "nome";
txtpesquisa.DataValueField = "id";
txtpesquisa.DataBind();
}