Skip to main content
Question

Save and next tab button

  • December 20, 2019
  • 0 replies
  • 138 views

I used to have a save and next button that would move the user to the next tab on my form.  It no longer works and i've tried to look at the new posts about what changed but it still doesnt work.  Here is what I have done

SaveAndNextTab.js
var nextTabLink=$("li.ui-tabs-active").next("[style!='display:none']").children("a");
$("#saveAndKeepWorkingMenuOption").click();
$(nextTabLink).click();
location.assign('#navTop');

 customButtonScript1
<a href='javascript:($.getScript("https://xxxx.quickbase.com/db/bpgjc56je?a=dbpage&pagename>

customButtonScript2
"));void(0);


button: 

[customButtonScript1]
& "SaveAndNextTab.js"
& [customButtonScript2]
& "' class='Vibrant' style='color:white; background:#427cd8; white-space:nowrap;'>Next</a>"

------------------------------
Mike Klausing
------------------------------
This topic has been closed for replies.

  • Registered
  • December 26, 2019
Mike,

I was able to adjust your provided code to make a working feature with a Rich Text field. Here's the working code:
var text customButtonScriptOne = "<a href=javascript:$.getScript('https://YOURREALM.quickbase.com/db/YOURDBID?a=dbpage&pagename=";
var text customButtonScriptTwo = "');void(0);";

$customButtonScriptOne
& "SaveAndNextTab.js"
& $customButtonScriptTwo
&  " class='Vibrant' style='color:white; background:#427cd8; white-space:nowrap;'>Next</a>"​
Note, I had to switch some of the " to ' and vice versa for this to work in Rich Text. Syntactically, yours would have worked in a .js page.

I can't speak as to why your code stopped working, but I was able to identify a few potential syntax errors. Updating these allowed the feature to work in my app.
  • No "=" after "pagename" (Line 1)
  • Extra anchor element closing bracket (Line 1)
  • No need to surround "javascript...void(0);" with single quotes. This may have caused some wires to get crossed when it comes to " or '
  • Potentially redundant () surrounding "javascript...void(0)"

By the way, this button is a really cool feature. Thanks for sharing it here.

Thanks,
------------------------------
Evan Westbrook
PRIME Developer
Harder Mechanical Contractors Inc.
Portland OR
------------------------------