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

finding selected value of DropDownList in Tab

1 Answer 65 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 2
Richard asked on 20 Jul 2009, 04:16 PM
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");  
 

1 Answer, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 23 Jul 2009, 11:59 AM
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.
Tags
TabStrip
Asked by
Richard
Top achievements
Rank 2
Answers by
Paul
Telerik team
Share this question
or