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

[Solved] how to get the index tab (TabStrip) selected with jquery?

2 Answers 162 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
lucas
Top achievements
Rank 1
lucas asked on 25 Aug 2010, 09:49 PM
Hello, Good Afternoon!

I have a screen with a TabStrip with four tabs in each tab has fields to be filled and sent to the server via a journal, remembering that I only have one form on the screen.

Before I make a post on the page I need to get the index of current tab, because after I take the post, the page will reload and I need to return to the same tab that generated the event post.

Somebody help me?


For example:

the TabStrip:
 
<%Html.Telerik().TabStrip()
            .Name("TabStrip")
            .Items(items =>
{
                    items.Add()

                    .Text("Open Travel")
.Content(() =>{
                    
\\\\
                     \\\\
%>


when an item is selected from a dropdown:

<%= Html.DropDownList("DropDown1", null, "Type", new { onchange = "Load_Update()" })%>

fires the following function:
         
function Load_Update() {
$(
"#Tab_Selected").val(/*here the value of the selected tab*/);               $("#form").submit();         
$(
"#div").show();  
}

and there in the controller get the value of the variable Tab_Selected!

How do I do?

2 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Krustev
Telerik team
answered on 26 Aug 2010, 08:20 AM
Hello lucas,

Check this forum thread devoted on the same matter. Once you get the index of the selected tab you can save it in a hidden HTML input and send it to the server.

All the best,
Georgi Krustev
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
0
lucas
Top achievements
Rank 1
answered on 26 Aug 2010, 06:45 PM
Thanks for your reply.
That's exactly what I need.

ASP.net MVC Forever!
Tags
General Discussions
Asked by
lucas
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
lucas
Top achievements
Rank 1
Share this question
or