Enable RadComboBox client-side

3 posts, 1 answers
  1. Ciupaz
    Ciupaz avatar
    47 posts
    Member since:
    Jun 2020

    Posted 11 Jul Link to this post

    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. Ciupaz
    Ciupaz avatar
    47 posts
    Member since:
    Jun 2020

    Posted 11 Jul in reply to Ciupaz Link to this post

    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?

     

  3. Answer
    Peter Milchev
    Admin
    Peter Milchev avatar
    857 posts

    Posted 14 Jul Link to this post

    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

Back to Top