ArchiveUser
8 years agoQrew Captain
Can jquery tabs return back to same tab once I update the form?
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();
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();