Forum Discussion
AlexWilkinson
6 years agoQrew Assistant Captain
Michael, apologies for flubbing #2. In a rush, I copied the wrong script. Below is the right one. You might want to save as something like "saveAndNextNotHiddenTab.js" to be extra clear when you later wonder what on earth you were thinking! If so, you need to use that same page-name in the body of the rich-text formula for the "Save and Next Tab" button.
- line 1 finds the next displayed tab
- line 2 clicks the standard save-and-keep-working button
- line 3 checks to be sure there is no pop-up error message, e.g., about a required field
- the rest says if there's no error, click the next unhidden tab and scroll to a good point.
- also, note in earlier comments that none of this works if you use &ifv= in your URL to hide Quick Base headers and other stuff.
var nextTabLink=$("li.ui-tabs-selected").next("[style!='display:none']").children("a");
$("#saveAndKeepWorkingMenuOption").click();
var noErrorDialog=$('#qbDialog').length==0;
if( noErrorDialog ){
$(nextTabLink).click();
location.assign("#mainBodyDiv");
};
- line 1 finds the next displayed tab
- line 2 clicks the standard save-and-keep-working button
- line 3 checks to be sure there is no pop-up error message, e.g., about a required field
- the rest says if there's no error, click the next unhidden tab and scroll to a good point.
- also, note in earlier comments that none of this works if you use &ifv= in your URL to hide Quick Base headers and other stuff.
var nextTabLink=$("li.ui-tabs-selected").next("[style!='display:none']").children("a");
$("#saveAndKeepWorkingMenuOption").click();
var noErrorDialog=$('#qbDialog').length==0;
if( noErrorDialog ){
$(nextTabLink).click();
location.assign("#mainBodyDiv");
};