Forum Discussion
MichaelHalbrein
7 years agoQrew Cadet
this works great. but i am stuck because of a variation in my tabs. i have a tab that only shows based on a dynamic rule. it is the second tab. however, if it is not showing and i click the save and next tab on the first tab section it just stays on the first tab section instead of going to the 3rd (again because the rule hid the 2nd tab). is there a trick to fix this?
- BradLemke6 years agoQrew Assistant CaptainSeveral steps would be taken:
First: Find out the tab number of the 3rd tab. (using Chrome) While in the form, right-click on the tab you want it to go to and click 'inspect'. This will open a menu on the side that will show you the tab's actual number.
Next: add a modified.JS page with the following code (striking out original code, bolding new code):var nextTabLink=$("li.ui-tabs-selected").next("[style!='display:none']").children("a");
$("#saveAndKeepWorkingMenuOption").click();
var noErrorDialog=$('#qbDialog').length==0;
if( noErrorDialog ){$(nextTabLink).click();$("#tab_t2_link a").click();
location.assign('#navTop');
};
Be sure to change the t2 to the tab number you found earlier.
Last, modify your custom button code with an if-statement:
If(*conditions for rule show 2nd tab*,
[customButtonScript1]
& "saveAndNextTab.js"
& [customButtonScript2]
& [customButtonStyleSKW]
& "Save & next tab"
& [customButtonEnd],
[customButtonScript1]
& "Modified.js"
& [customButtonScript2]
& [customButtonStyleSKW]
& "Save & next tab"
& [customButtonEnd]
)