<script type="text/javascript">
$(document).ready(function () {
$('#ddlCategory').change(function () {
$.ajax({
type: "post",
url: "/LogPhoneCalls/GetSubcategories",
data: { selectedCategoryID: $('#ddlCategory').val() },
datatype: "json",
traditional: true,
success: function (data) {
var subcategory = "<select id='ddlSubcategory'>";
subcategory = subcategory + '<option value="">--Select--</option>';
for (var i = 0; i < data.length; i++)
{
subcategory = subcategory + '<option value=' + data[i].Value + '>' + data[i].Text + '</option>';
}
subcategory = subcategory + '</select>';
$('#Subcategory').html(subcategory);
}
});
});
});
$(document).on('change', '#ddlSubcategory', function () {
$.ajax({
type: "post",
url: "/LogPhoneCalls/GetResolutions",
data: {
selectedCategoryID: $('#ddlCategory').val(),
selectedSubcategoryID: $('#ddlSubcategory').val()
},
datatype: "json",
traditional: true,
success: function (data) {
var resolution = "<select id='ddlResolution'>";
resolution = resolution + '<option value="">--Select--</option>';
for (var i = 0; i < data.length; i++) {
resolution = resolution + '<option value=' + data[i].Value + '>' + data[i].Text + '</option>';
}
resolution = resolution + '</select>';
$('#Resolution').html(resolution);
}
});
});
</script>