Reputation: 21
this is the function, and below designer code. I have updated the code with the latest answer
function OnClientLoBChecked(sender, args) {
var ChkBoxLOB = document.getElementById("<%= cbFLoB.ClientID %>");
var ChkBoxDis = document.getElementById("<%= chkBoxShowNewProjects.ClientID %>");
if (ChkBoxLOB.Checked) {
ChkBoxDis.checked = false}
else{
ChkBoxDis.checked = true
}
filterChanged();
}
<telerik:radcombobox id="cbFLob" runat="server" datatextfield="LobName" checkboxes="true" OnClientItemChecked="OnClientItemChecked">
Upvotes: 0
Views: 94
Reputation: 5258
Aside from the incorrectly capitalized document.getElementById()
in your code, the real issue is that ChkBoxLob
will always be undefined.
You are using $find which is an
ASP.net
function that finds components registered with theaddComponent
method.
These components are .net AJAX server controls
that have a JavaScript counterpart. The $find()
method is not meant to be used like the JavaScript document.getElementById()
or the jQuery $('#someId)
notation.
That is why chkBoxLob
is always undefined;
Use document.getElementById
instead in both places.
var ChkBoxLob = document.getElementById("<%= cbFLob.ClientID %>");
var ChkBoxDis = document.getElementById("<%= chBoxNewProjects.ClientID %>");
Note also the capitalized .ClientID
property.
Upvotes: 2