Skip to main content
Question

Can jquery tabs return back to same tab once I update the form?

  • November 17, 2016
  • 0 replies
  • 209 views

I am using Dan's jquery code below. I love it and my users love it. However, we noticed that once we update the form the tab code returns us to the first tab instead of taking us back to the tab we were in.

Is there a way to modify the code so it returns us to the current tab instead of returning to the first tab?

Thanks guys!



"<img qbu=\"module\" src=\"/i/clear2x2.gif\" " &

"onload=\"javascript:if(typeof QBU=='undefined'){QBU={};$.getScript('" &

URLRoot() &

"db/" &

Dbid() &

"?a=dbpage&pagename=module.js&rand='+Math.random())}\">"

on the Code Page I have this code:

Page name is module.js


Code:

 var markup = "";

    markup += "<ul>";

    $("#formContents div.sectionDiv").each(function(index){

      markup += "<li><a href='#tab_" + (index+2) + "'>" + $("span.sectionTitle",this).text() + "</a></li>";

    });

    markup += "</ul>";



    $("#formContents").prepend(markup);



    $("#formContents div.sectionDiv").each(function(index){

      $(this).attr("id","tab_" + (index+2));

      $("div:lt(2)",this).hide();

    });



    $("#formContents").tabs();
This topic has been closed for replies.

  • Registered
  • November 17, 2016
You would have to save the current tab in localStorage after every tab change and read it back in when the form reopens and set the current tab. This is how QuickBase remembers open sections on a per user basis.

This is not something I would contribute publicly so if you want to pursue a solution feel free to contact me off-world using the information in my profile:

https://quickbase-community.intuit.com/users/513/

  • Registered
  • May 30, 2017
Hi I am facing the same issue I have tabs but need a way modify the code so it returns us to the current tab. I don't see anything in Dan's profile that would allow me to contact him. If Dan or anyone else can help me  would appreciate it. 

My code is 

var markup = "";    markup += "<ul>";
    $("#formContents div.sectionDiv").each(function(index){
      markup += "<li><a href='#tab_" + (index+1) + "'>" + $("span.sectionTitle",this).text() + "</a></li>";
    });
    markup += "</ul>";

$("#formContents").prepend(markup);

    $("#formContents div.sectionDiv").each(function(index){
      $(this).attr("id","tab_" + (index+1));
      $("div:lt(2)",this).hide();
    });

  $("#formContents").tabs();