i am trying to disable a drop down list control
here is the code
$("#payment").attr('disabled', 'disabled');
this does not seem to happen at all
here is the payment control
<label for="payments">Payment Type: </label><input id="payment" data-bind="value: payment" name="payment" />
and the code load the datasource
and the function to disable the control by another drop down list choice
the alert's work but the .attr is never firing
here is the code
$("#payment").attr('disabled', 'disabled');
this does not seem to happen at all
here is the payment control
<label for="payments">Payment Type: </label><input id="payment" data-bind="value: payment" name="payment" />
and the code load the datasource
$.ajax({
url: 'dsr.asmx/get_Payment',
async: true,
cache: false,
timeout: 30000,
contentType: 'application/json; charset=utf-8',
data: "{}",
type: 'POST',
dataType: 'json',
success: function (msg) {
$("#payment").val("revpay").kendoDropDownList({
index: 0,
optionLabel: "Select Payment Type",
dataTextField: "Description",
dataValueField: "Code",
filter: "contains",
suggest: true,
minLenght: 1,
change: onPayChange,
dataSource: {
data: msg.d
}
});
}
});
and the function to disable the control by another drop down list choice
function onResChange() {
var res = document.getElementById("result").value;
switch (res) {
case 'c':
alert('Canceled');
$("#payment").attr('disabled', 'disabled');
break;
case 'cb':
alert('Call Back no Sale');
break;
}
}
the alert's work but the .attr is never firing