Forum Discussion
AlexWilkinson
8 years agoQrew Assistant Captain
Here's a cleaner way to do this, replicating the color and style of the standard 'Save & keep working button' while allowing it to be placed anywhere on the form:
1) In the form properties, check the box to "Show save & keep working choice." (It's not necessary to also check the box to show the save and cancel buttons at the bottom of the form. That's optional.)
2) Create a global variable for your app at Setting >> Variables ... Let's say you call it "mySaveKeepWorking" or something similar ... and give it exactly the following value (the quotes are critical!)
<a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='$("#saveAndKeepWorkingMenuOption").click();'>Save & keep working</a>
3) In your table, create a rich text variable ... say it's called "mySKW" and give it exactly and only the following value:
[mySaveKeepWorking]
4) In your form, place the mySKW field wherever you want, as often as you like. Each time, be sure to check the box for "Use Alternate Label Text" while leaving the value blank, and to set the form-row for "edit and add" modes.
When you save the form, Quick Base will ask you to confirm that you really do want the mySKW field to appear multiple times, which you do!
That's it. One wrinkle: it might be nice to have mySKW return to the same spot on the form where it was clicked. That's doable but a bit fancier. Post back here if interested.
1) In the form properties, check the box to "Show save & keep working choice." (It's not necessary to also check the box to show the save and cancel buttons at the bottom of the form. That's optional.)
2) Create a global variable for your app at Setting >> Variables ... Let's say you call it "mySaveKeepWorking" or something similar ... and give it exactly the following value (the quotes are critical!)
<a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='$("#saveAndKeepWorkingMenuOption").click();'>Save & keep working</a>
3) In your table, create a rich text variable ... say it's called "mySKW" and give it exactly and only the following value:
[mySaveKeepWorking]
4) In your form, place the mySKW field wherever you want, as often as you like. Each time, be sure to check the box for "Use Alternate Label Text" while leaving the value blank, and to set the form-row for "edit and add" modes.
When you save the form, Quick Base will ask you to confirm that you really do want the mySKW field to appear multiple times, which you do!
That's it. One wrinkle: it might be nice to have mySKW return to the same spot on the form where it was clicked. That's doable but a bit fancier. Post back here if interested.
- QuickBaseCoachD8 years agoQrew CaptainThx for posting. Is there similar syntax for a (regular) Save button?
- _anomDiebolt_8 years agoQrew EliteAlex's formula:
<a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='$("#saveAndKeepWorkingMenuOption").click();'>Save & keep working</a>
can be shortened to this (not tested):<a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='saveAndKeepWorkingMenuOption.click();'>Save & keep working</a>
It is a little know fact (to even seasoned developers) that modern browsers automatically create a global variable named after every attribute id in the page. So in the above formula instead of using a jQuery selector and jQuery's click() method, you can use native JavaScript and a raw reference to the global variable saveAndKeepWorkingMenuOption.
This can be applied to Mark's inquiry as well. These two fragments are essentially equivalent:<a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='$("#saveButton").click();'>Save & Nothing More</a>
<a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='saveButton.click();'>Save & Nothing More</a>- RichieEyles15 years agoQrew MemberCan we check a box first and then save and carry on, when it is a new record?
------------------------------
Richie Eyles
------------------------------
- AlexWilkinson8 years agoQrew Assistant CaptainYes. You could make three global variables, one for each of the possible values on the drop-down in the standard green save button.
the field "mySC" would use [mySaveClose] which would have #saveMenuOption
the field "mySN" would use [mySaveNext] would have #saveAndNextMenuOption
... instead of #saveAndKeepWorkingMenuOption ... otherwise everything is identical.
Quick Base could change these, of course, but that seems low-probability for now. You can find them by using the developer tools in your browser to inspect the source code for a page, and doing ctrl-F for "#save" ... - _anomDiebolt_8 years agoQrew Elite> You could make three global variables,
The browser creates these global variables automatically. All you have to do is use them!
This part of my message may have been clipped:
This can be applied to Mark's inquiry as well. These two fragments are essentially equivalent:<a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='$("#saveButton").click();'>Save & Nothing More</a>
This technique comes in handy when referencing fields on new and edit forms. Instead of this:
<a class='Vibrant' style='font-size:14px; color:white; background:#6BBD57; white-space:nowrap;' onclick='saveButton.click();'>Save & Nothing More</a>$("_fid_6")[0]
ordocument.getElementById("_fid_6")
you can just use this:
_fid_6 - AlexWilkinson8 years agoQrew Assistant CaptainHaven't tested the 'Save & Nothing More' idea, but looking at the HTML, I am wondering if it will do Save & close OR Save & next OR Save & keep working ... depending on what the user last selected from the save button menu ??? (Save & close would be the default, if the user had never selected another option.)
- HectorAubert7 years agoQrew Trainee
have mySKW return to the same spot on the form where it was clicked. That's doable but a bit fancier. Post back here if interested.
I'm interested in this - ZVIBOCK7 years agoQrew CadetCould you please let me know how you get it back to the same spot? I am very much in need of that behavior