I am trying to pass the value of the textbox into my datasource so I can pre-filter my AJAX result set. The following code always gives me an empty string for "issueid". The values I am passing for "token" and "rnd" work just fine. Debugging in the console for "$("#kAutoDuplicateId").val()" reveals the textbox value just fine as well.
<
input
id
=
"kAutoDuplicateId"
style
=
"width: 500px;"
/>
<
script
type
=
"text/javascript"
>
$(document).ready(function () {
$("#kAutoDuplicateId").kendoAutoComplete({
minLength: 1,
dataTextField: "Id",
template: 'Service Request ID: #: data.Id # - #: data.RequestType #',
filter: "startswith",
dataSource: {
transport: {
read: {
type: 'POST',
url: '/pages/ajax/searchreports.ashx',
dataType: "json",
data: {
issueid: $("#kAutoDuplicateId").val(),
token: $('#hdnCsrfToken').val(),
rnd: Math.random()
}
}
},
pageSize: 5
},
placeholder: 'Enter the ID...'
});
});
</
script
>