finding selected value of DropDownList in Tab

2 posts, 0 answers
  1. Richard
    Richard avatar
    63 posts
    Member since:
    Apr 2008

    Posted 20 Jul 2009 Link to this post

    I have a DropDownList inside of a PageView on my tabstrip.  Can someone give me a javascript example of how I would reference the DropDownList and more importantly, how to find the SelectedText of the DropDownList?

    I am using the following code to reference the DropDownList, but cannot get the selected text:

    var filterName = $telerik.findElement(pageView1.get_element(), "ddlFilterNames");  
     
  2. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 23 Jul 2009 Link to this post

    Hello Richard,

    Nothing special about that - you just reference it directly, i.e.

     <form id="form1" runat="server"
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
     
        <script type="text/javascript"
            function test() { 
                var dd = $get("<%= DropDownList1.ClientID %>"); 
                alert(dd); 
            } 
        </script> 
     
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0" MultiPageID="RadMultiPage1"
            <Tabs> 
                <telerik:RadTab runat="server" Selected="True" Text="Root RadTab1"
                </telerik:RadTab> 
            </Tabs> 
        </telerik:RadTabStrip> 
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"
            <telerik:RadPageView ID="RadPageView1" runat="server"
                RadPageView1 
                <asp:DropDownList ID="DropDownList1" runat="server"
                    <asp:ListItem>1</asp:ListItem> 
                    <asp:ListItem>2</asp:ListItem> 
                    <asp:ListItem>3</asp:ListItem> 
                    <asp:ListItem>4</asp:ListItem> 
                </asp:DropDownList> 
            </telerik:RadPageView> 
        </telerik:RadMultiPage> 
        <input id="Button1" type="button" value="button" onclick="test()" /> 
        </form> 



    Kind regards,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top