Save and Position after Save?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

I have this code which nicely makes a Green save button which I can put in the middle of my form. 

"<a id='saveButton' class='Vibrant Success' onclick='DoSaveAdd()' href='#'>Save</a>"

Is there a way to have the button position to an anchor tag on the form such as this one?

"<a name=JumpTarget></a>"






Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,316 Points 50k badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,894 Points 20k badge 2x thumb
This example sets the vertical scroll position to what it was on the previous edit.

Keeper of The Scrolls
https://haversineconsulting.quickbase.com/db/bj978knct?a=er&rid=1

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=456


Notes 

(1) I only implemented this feature on the edit record page

(2) When an existing record is saved the current scroll position (in pixels) is saved is session storage under the following key:

QBU/51084879/bj978knct/2/scroll

This key is built up with the QBU (QuickBase User) prefix, followed by the user id,, followed by the table dbid, followed by the form id, followed by the property name "scroll"
(3) When the edit record form is subsequently opened the session key is read and if it exists will restore the scrool position of the page.

(4) Using session storage is the way QuickBase saves the open/closed state of form sections.
(5) This is a very general technique which could be adopted to a variety of data entry scenarios. For example if you wanted to fill in default values into a form based on the state of the prior form you could set and get field values in session storage.
(6) You will probably have to add additional logic and features to your implementation to get the workflow you want but the changes to my code will be pretty simple. Feel free to contact me privately if you need additional help.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,316 Points 50k badge 2x thumb
Thx Dan.  That's a little more complicated than i was hoping for but thank you for answering.
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 29,894 Points 20k badge 2x thumb
It is extremely simple at a mere 22 lines of code and six empty lines to improve readability. You have to up your game and embrace the script!