Tab Wizard (client-side) Documentation - Javascript Code is missing tags

2 posts, 0 answers
  1. Odin
    Odin avatar
    2 posts
    Member since:
    Nov 2011

    Posted 23 Nov 2011 Link to this post

    Hi,
    Tab Wizard (client-side)  Documentation - Javascript Code is missing tags.
    http://www.telerik.com/help/aspnet-ajax/tabstrip-tab-wizard.html


    Here is the code on the page.
    <form id="form1" runat="server">
       <script type="text/javascript">
       function onNavigate(isMoveNext)
       
           var tabs = $find('<%= rtbstMain.ClientID %>');
           var totalNumOfTabs = tabs.get_tabs().get_count();
           if(totalNumOfTabs > 0) {
               var newTabIndex;
               var currentTabIndex = tabs.get_selectedIndex();
     
               if(isMoveNext){
                   if(currentTabIndex + 1 == totalNumOfTabs) {
                       newTabIndex = 0;
                   }
                   else {
                       newTabIndex = currentTabIndex + 1;
                   }
               }
               else{
                   if(currentTabIndex - 1 < 0) {
                       newTabIndex=totalNumOfTabs - 1else {
                       newTabIndex=currentTabIndex - 1tabs.set_selectedIndex(newTabIndexscript>
       <asp:ScriptManager ID="smPageScriptManager" runat="server" />
       <telerik:RadTabStrip ID="rtbstMain" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0">
           <Tabs>
               <telerik:RadTab runat="server" Text="Root RadTab1" Selected="True">
               </telerik:RadTab>
               <telerik:RadTab runat="server" Text="Root RadTab2">
               </telerik:RadTab>
               <telerik:RadTab runat="server" Text="Root RadTab3">
               </telerik:RadTab>
           </Tabs>
       </telerik:RadTabStrip>
       <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0">
           <telerik:RadPageView ID="RadPageView1" runat="server">
               RadPageView1</telerik:RadPageView>
           <telerik:RadPageView ID="RadPageView2" runat="server">
               RadPageView2</telerik:RadPageView>
           <telerik:RadPageView ID="RadPageView3" runat="server">
               RadPageView3</telerik:RadPageView>
       </telerik:RadMultiPage>
       <asp:Button ID="Button1" runat="server" Text="Prev" OnClientClick="onNavigate(false); return false;" />
       <asp:Button ID="Button2" runat="server" Text="Next" OnClientClick="onNavigate(true); return false;" />
    </form>

    I am horrible at jQuery/Javascript but need the code. I have to make a multi-form wizard. Wanted to see if I can avoid postback since I am using Async Upload on one of the tabs. 

    Any suggestion welcome.

  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 24 Nov 2011 Link to this post

    Hi Odin,

    Thank you for pointing this one.

    I have already fixed this issue in our documentation and it will be available next week. Meanwhile you can refer to the following code:
    function onNavigate(isMoveNext)
        var tabs = $find('<%= rtbstMain.ClientID %>');
        var totalNumOfTabs = tabs.get_tabs().get_count();
        if(totalNumOfTabs > 0) {
            var newTabIndex;
            var currentTabIndex = tabs.get_selectedIndex();
     
            if(isMoveNext){
                if(currentTabIndex + 1 == totalNumOfTabs) {
                    newTabIndex = 0;
                }
                else {
                    newTabIndex = currentTabIndex + 1;
                }
            }
            else{
                if(currentTabIndex - 1 < 0) {
                    newTabIndex = totalNumOfTabs - 1;
                }
                else {
                    newTabIndex = currentTabIndex - 1
                }
            }
            tabs.set_selectedIndex(newTabIndex);
        }
    }

    Kind regards,
    Kate
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top