I got there – here’s the final code I ended up with:
function showSpreadsheet(){
var S1a = getFieldValue("S1a");
var S1b = getFieldValue("S1b");
if(S1a === "Yes" || S1b === "No"){
spjs.dffs.toggleVisibleTab("Spreadsheet",true);
spjs.dffs.toggleVisibleTab("Model",false);
spjs.dffs.toggleSelectedTab("Spreadsheet");
if(S1a === "No" || S1b === "Yes"){
spjs.dffs.toggleVisibleTab("Spreadsheet",true);
spjs.dffs.toggleVisibleTab("Model",false);
spjs.dffs.toggleSelectedTab("Spreadsheet");
if(S1a === "Yes" && S1b === "Yes"){
spjs.dffs.toggleVisibleTab("Spreadsheet",true);
spjs.dffs.toggleVisibleTab("Model",false);
spjs.dffs.toggleSelectedTab("Spreadsheet");
}else{
spjs.dffs.toggleVisibleTab("Spreadsheet",false);
spjs.dffs.toggleVisibleTab("Model",true);
spjs.dffs.toggleSelectedTab("Model");
}
}
}
}
// Change event on dropdown
spjs.$("#dffs_S1a", "#dffs_S1b").on("click",function(){
showSpreadsheet();
});