This is a migrated thread and some comments may be shown as answers.

Find RadComboBox at JavaScript without <%= xxxxxx.ClientID %>

0 Answers 73 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Paulo Goncalves
Top achievements
Rank 2
Paulo Goncalves asked on 21 Dec 2017, 02:10 PM

Hi, 

I have a form with many checkbox and each checkbox has a RadCombo or RadTextBox beside. When checkbox change, the application need enable or disable the respective RadComboBox or RadTextBox. 

When I use with RadTextBox was working fine. But I call the RadComBox the $Find JQuery return null. 

I would like have one or twice(combo and text) Javascript function. I don´t like create one JS with <RadComboBoxXX.ClientID> for each ComboBox. And don´t use server code.

 

Thanks for any help.

<script type="text/javascript">
        function EnableDisable(chk, ctrl) {
            var e = $find(ctrl);
            if(chk) {
                e.enable();
            }
            else {
                e.disable();
            }
        }
</script>
 
---- Work Fine----
<asp:Checkbox ID="CheckBox1" runat="server"  OnClick="EnableDisable(this.checked,'RadTextBox1');"/>
<telerik:RadTextBox ID="RadTextoBox1" runat="server" />
 
 
---- Don´t work ----
<asp:Checkbox ID="CheckBox2" runat="server"  OnClick="EnableDisable(this.checked,'RadComboBox2');"/>
<telerik:RadComboBox ID="RadComboBox2" runat="server" />

 

 

No answers yet. Maybe you can help?

Tags
ComboBox
Asked by
Paulo Goncalves
Top achievements
Rank 2
Share this question
or