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

How to check for a disabled combobox in JavaScript

1 Answer 279 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
DonKitchen
Top achievements
Rank 1
DonKitchen asked on 20 Apr 2011, 09:54 PM
I would like to know how I can check (via JavaScript) if a given combobox is enabled or not.  I see how to enable or disable it, but not how to check the status.

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 21 Apr 2011, 04:40 AM
Hello Don,

The RadComboBox provides a flexible client-side API. You can easily interact with the combobox in the browser using the combobox client-side object. The client side method  get_enabled() checks whether the object is enable or disabled.

Here is a sample code:
aspx:
     <telerik:RadComboBox  ID="RadComboBox1" Enabled="false"
            runat="server">
            <Items>
                <telerik:RadComboBoxItem runat="server" Text="No Postback Item 1" />
                <telerik:RadComboBoxItem runat="server" Text="Do postback Item 1" />
                <telerik:RadComboBoxItem runat="server" Text="No postback Item 2" />
                <telerik:RadComboBoxItem runat="server" Text="Do postback Item 2" />
            </Items>
</telerik:RadComboBox>
 <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="Check();" />

Javascript:
function Check()
    {
       var combo = $find('<%=RadComboBox1.ClientID%>');
       alert(combo.get_enabled());
   }

Thanks,
Shinu.
Tags
ComboBox
Asked by
DonKitchen
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or