I am using html drop-down to get the data for it dynamically from SharePoint list.
Also, I required to trigger the query on change of option for this drop-down. I am not even getting the "Alert" message. Can any one help what's wrong in my control.I assume the issue is in control.
<select id="drbfunction" class="select" onChange="getFiltermonths()";>
<option selected="selected">Select</option>
</select>
function getFiltermonths()
{
alert("in Filter Months function");
var mymonthvalue=document.getElementById("drbfunction").value;
var clientContext = new SP.ClientContext.get_current();
var oList = clientContext.get_web().get_lists().getByTitle('MyTableTopSessions');
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml("<View><Query><Where><Eq><FieldRef Name='Title' /><Value Type='Text'>"+mymonthvalue+"</Value></Eq></Where></Query></View>");
this.collListItem = oList.getItems(camlQuery);
clientContext.load(collListItem);
clientContext.executeQueryAsync( Function.createDelegate(this, this.onQuerySucceeded),Function.createDelegate(this, this.onQueryFailed) );
}
getFiltermonthsfunction should be called ononChangeevent.