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

Enable RadButton when item from RadCombobox is selected

1 Answer 135 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Darrin
Top achievements
Rank 1
Iron
Darrin asked on 04 Aug 2016, 02:58 PM

I have a radbutton on my form that is disabled.

I have about 10 RadComboboxes on the same form.

I'm trying to enable the Radbutton once a Value is selected from the any of the comboboxes.

Can't seem to get this working.

Any help would be appreciated.

 

<telerik:RadComboBox ID="ddl1" runat="server" Width="90px" Skin="Vista" Font-Names="Verdana" Font-Size="Small" ZIndex="8900" OnClientDropDownOpening="Enable_Save">
                        </telerik:RadComboBox>

 

<script type='text/javascript'>
function Enable_Save()
{
    if(document.getElementById("ddl1").value!="")
        document.getElementById("b1").disabled=false;
    else
    document.getElementById("b1").disabled=true;

}

</script>

 

 

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 08 Aug 2016, 02:09 PM
Hello Darrin,

Instead of using OnClientDropDownOpening subscribe the ComboBoxes to the OnClientSelectedIndexChanged event:
<telerik:RadComboBox ID="RadComboBox1" runat="server" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged">
</telerik:RadComboBox>

in the event's handler get the button and call its set_enabled() client-side method passing true in order to enable it:
function OnClientSelectedIndexChanged(sender, eventArgs) {
    var button = $find("<%=b1.ClientID %>");
    button.set_enabled(true);
}



Regards,
Ivan Danchev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
ComboBox
Asked by
Darrin
Top achievements
Rank 1
Iron
Answers by
Ivan Danchev
Telerik team
Share this question
or