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

Enabling RadComboBox using Javascript

3 Answers 458 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Monik
Top achievements
Rank 1
Monik asked on 20 Jul 2015, 06:16 AM

I have following RadComboBox that triggers a javascript function which in turn enables a different RadComboBox

<telerik:RadComboBox ID="ddlMode"  runat="Server"  CssClass="selectBox"  AutoPostBack="false"  Width="90"  Font-Size="Small" OnClientSelectedIndexChanged="ddlMode_OnClientSelectedIndexChanged"><Items><telerik:RadComboBoxItem Text="New" Value="0" Selected="true"/><telerik:RadComboBoxItem Text="Edit" Value="1"  />
</Items>
</telerik:RadComboBox>

 

Following is the Javascript called:

function ddlMode_OnClientSelectedIndexChanged(sender, args) {
          debugger;
          var category = $find("<%= ddlPRInfo_ItemCategory.ClientID %>");
          category.enabled = true;
}

But it doesn't work.

Please guide on same..

3 Answers, 1 is accepted

Sort by
0
Aneliya Petkova
Telerik team
answered on 20 Jul 2015, 09:58 AM
Hi Monik,

The .enabled client-side property of RadComboBox returns a bool value - true or false, showing if the control is enabled or it is disabled.

To enable the control, you must use enable() method:
function ddlMode_OnClientSelectedIndexChanged(sender, args) {
    var category = $find("<%= ddlPRInfo_ItemCategory.ClientID %>");
    category.enable();
}

Regards,
Aneliya Petkova
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Monik
Top achievements
Rank 1
answered on 20 Jul 2015, 10:13 AM

Hi Aneliya,

Thanks for the reply, I tried with your suggestion and it still doesnt work.

0
Aneliya Petkova
Telerik team
answered on 20 Jul 2015, 10:45 AM
Hi Monik,

I made for you a sample project using the code you provided, where on selection of item from the first RadComboBox, the second one gets enabled. Here you may find a video, showing the result of my test.

You may find more information on client-side API in our documentation:
http://docs.telerik.com/devtools/aspnet-ajax/controls/combobox/client-side-programming/overview

Hope this will be helpful.

Regards,
Aneliya Petkova
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ComboBox
Asked by
Monik
Top achievements
Rank 1
Answers by
Aneliya Petkova
Telerik team
Monik
Top achievements
Rank 1
Share this question
or