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

[Solved] Using onclientselectedindexchanged to display another control

1 Answer 104 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Joel Jordan
Top achievements
Rank 1
Joel Jordan asked on 15 Mar 2010, 03:16 PM
I have a radcombox and a span next to each other.  I want to set the style.display = "none" of sBtns when a certain item is selected in the combo box.  How do I access the span object in client side script?

                <telerik:radcombobox id="cboPortfolioView" runat="server" tabindex="1"   
                    onclientselectedindexchanged="SectorAcctTypeDisplay">  
                            </telerik:radcombobox> 
                <span id="sBtns" runat="server">  
                    <asp:RadioButton ID="radAll" runat="server" Checked="True" GroupName="SectorAcctType" 
                        Text="All" /> 
                    <asp:RadioButton ID="radAfs" GroupName="SectorAcctType" Text="AFS" runat="server" /> 
                    <asp:RadioButton ID="radHtm" GroupName="SectorAcctType" Text="HTM" runat="server" /> 
                </span> 

<script language="javascript" type="text/javascript">  
<!--  
    function SectorAcctTypeDisplay(sender, eventArgs) {  
        var item = eventArgs.get_item();  
        var val = item.get_value();  
        alert("val: " + val);  
 
        if (val == "0") {  
            sBtns.style.display = "none";  
        }  
    }  
-->  
</script> 


Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 15 Mar 2010, 03:22 PM
Hi Joel Jordan,

You can use document.getElementById("sBtns") to get the span DOM element.

Sincerely yours,
Simon
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
ComboBox
Asked by
Joel Jordan
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or