Forum Discussion
- QuickBaseCoachDQrew CaptainMatt, can you explain the purpose of this request, ie what are you trying to accomplish here?
- MatthewScammel1Qrew TraineeThanks for the speedy response!
I'm trying to pass in which tab the user was on when they clicked the Save & Close button, so I could use some jquery to "click" them back to that tab after they have saved and they are back in view mode. - _anomDiebolt_Qrew EliteYou can include any query parameter you want in the URL so long as you do not conflict with existing parameters - QuickBase will just ignore it. But you will have to arrange for script run in the page using an injection technique - such as IOL - that will read the URL parameter and synthesize a click on the appropriate tab. The relevant code to extract the query string parameter is this:
var urlParams = new URLSearchParams(window.location.search);
var customValue = urlParams.get("customeQueryStringParam"); - MatthewScammel1Qrew TraineeThank you for your response. I'm able to set and get the query string param when creating a custom button because adding the query string is as easy as adding it to the URL in the formula field.
The part I'm having trouble with is inside of my script (which is using the IOL technique), I'm unable to set a query string param that will show up in the URL once the page goes from Edit mode back to View (after clicking the Save & Close button). - _anomDiebolt_Qrew EliteGenerally when you submit a page the server alone will control what page you redirect to so you have no control over that form of submission. However there is a crude form of redirection built into QuickBase forms that continues to work (I just manually tested it).
If you sent these two hidden fields as follows when the page submits you will save the record and redirect to ibm.com (replace with your URL):$("input[name=RedirectURL]").val("http://www.ibm.com");
I don't often use this method as QuickBase could easily rework the form submission process and eventually they will. Try pasting the code into the console before putting it in a code page.
$("input[name=rl]").val(""); - MatthewScammel1Qrew TraineeWorked perfectly, thanks a lot!
- _anomDiebolt_Qrew EliteIf it works that is the end of it so party on. However, you can probably accomplish the same result without passing custom query parameters. Just do everything in one single script and skip over the parameter passing.
- AlexWilkinsonQrew Assistant CaptainAnother way to do this is to create a custom button "Save & same tab" which works like (and actually uses) the standard "Save & keep working" button except that it navigates back to the same tab. For details see this new post, which also includes a "Save & next tab" button.