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

Enable RadComboBox client-side

2 Answers 162 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ciupaz
Top achievements
Rank 2
Veteran
Ciupaz asked on 11 Jul 2020, 05:42 AM

Hello,

I have 2 RadComboBox with multi checkboxes. The first Is enabled and the second no.

How can I write a JavaScript function the enable the second RadComboBox when the user select at least one checkbox in the first combobox?

Thank you in advance.

Luis

2 Answers, 1 is accepted

Sort by
0
Ciupaz
Top achievements
Rank 2
Veteran
answered on 11 Jul 2020, 02:30 PM

I have tried in this way: 

<telerik:RadComboBox ID="cmbFormat"
                EmptyMessage="Format"
                MarkFirstMatch="true" Width="100%" runat="server" CheckBoxes="true"
                DataTextField="Descrizione" AutoPostBack ="true" EnableCheckAllItemsCheckBox ="true"
                DataValueField="Codice"
                OnClientItemChecking="enable" >
</telerik:RadComboBox>

 

<script type="text/javascript">
    function enable() {
      document.getElementById("cmbPositions").enabled = true;
    }
</script>

 

where cmbPositions is another RadComboBox set disable in the Page_Load (in If Not IsPostBack).

But is does not work, and the RadComboBox remain disabled. 

Any idea?

 

0
Accepted
Peter Milchev
Telerik team
answered on 14 Jul 2020, 02:11 PM

Hello Luis,

I would recommend checking the Getting Started section of our documentation where the client-side events convention and client-side API of the controls is explained:

Here is also the ComboBox related documentation:

As for obtaining the client-side object of Telerik controls, I recommend reviewing the following article:

function enable(sender, args) {
    var positionsComboBox = $find("<%= cmbPositions.ClientID %>");
    positionsComboBox.set_enabled(true);
}

Regards,
Peter Milchev
Progress Telerik

Tags
ComboBox
Asked by
Ciupaz
Top achievements
Rank 2
Veteran
Answers by
Ciupaz
Top achievements
Rank 2
Veteran
Peter Milchev
Telerik team
Share this question
or