Javascript equivalent of onchange()

2 posts, 1 answers
  1. Keith
    Keith avatar
    23 posts
    Member since:
    Jan 2013

    Posted 28 Oct 2016 Link to this post

    I would like to fire a RadComboBox's SelectedIndexChanged event from another function in JS.  For a standard dropdown list I would use "onchange()" but for the RadComboBox I get TypeError: RadComboBox1.onclick is not a function.  Is there a way to fire a selectedindexchanged event from javascript on a radcombobox?



    function fireSelectedIndexChanged() {
        var comboBox = $find("<%=RadComboBox1.ClientID%>");
        comboBox.onchange(); <---- fire selectedindexchanged event

  2. Answer
    Anton avatar
    81 posts

    Posted 01 Nov 2016 Link to this post

    Hello Keith,

    In order the SelectedIndexChanged event to be fired there has to be a selection on the items in the ComboBox. You can fire it by selecting a different item from the currently selected item and you could do that from any function. Take a look at the code below:

    <form id="form1" runat="server">
        <telerik:RadScriptManager runat="server"></telerik:RadScriptManager>
            <telerik:RadComboBox ID="RadComboBox1" runat="server" RenderMode="Lightweight"
                    <telerik:RadComboBoxItem runat="server" Text="Item1" Value="Item1" />
                    <telerik:RadComboBoxItem runat="server" Text="Item2" Value="Item2" />
        function pageLoad() {
            var combo = $find("<%= RadComboBox1.ClientID  %>");
            var item = combo.get_items().getItem(0);
        function OnClientSelectedIndexChanged(sender, args) {
            alert("SelectedIndexChanged fired from pageLoad");

    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Back to Top