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

[Solved] How to handle tab selection change?

0 Answers 185 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kapil Koli
Top achievements
Rank 1
Kapil Koli asked on 09 Jul 2010, 01:49 PM
Hi,
    I am using telerik tab strip in m MVC app.
    I want to show confirmation message on tab selection change.
    e.g. If I have 3 tabs i.e. "Tab1", "Tab2", "Tab3" . On page load, i select "Tab1" by default.
    Now if I click on "Tab2", I need to show a confirmation message (Yes/No message box).
    On chosing No, I want to stay on Tab1 and on yes, I want to select Tab2
    
    I have done following script for selecting tab but it's not working.
    
function onTabSelect(e) {
         if(confirm("Do you want to change?"))
{
          var tabstrip = $("#tbcTabStrip1").data("tTabStrip");
          var item = $("li", tabstrip.element)[0];
          tabstrip.select(item);
}
else
{
tabstrip.select(document.getElementById("hdnTabIndex"));
}
        
      }

    How can I achieve this.

Thanks,
Kapil
Tags
TabStrip
Asked by
Kapil Koli
Top achievements
Rank 1
Share this question
or