Home › Forums › Classic DFFS › Save Message Dialog Box
- This topic has 7 replies, 2 voices, and was last updated 10 years ago by Kyle Vaske.
-
AuthorPosts
-
-
November 18, 2014 at 20:18 #6629
Is there a way to have a dialog box appear that will have a Yes/No checkbox option when the Save button is clicked? For example, when they click Save, an Alert will appear saying “Is this form Complete or still In Progress?”, the user would then have to select one of the options in order for the save to process?
-
November 22, 2014 at 09:02 #6648
Add this code to the Custom JS section:
function dffs_PreSaveAction(){ if(!confirm("Save the form?")){ return false; } }
Alexander
-
November 24, 2014 at 17:32 #6661
Sorry I may not have clarified well enough. The form is something they fill out continuously throughout their shifts. What they are asking for is a Pre-Save, and Final-Save. So when they click the normal Save button, the dialog box would appear asking “Is this form Complete or still In Progress?” If “In Progress”, it would mark a Save Status (choice column with options of “Complete” or “In Progress”) field as In Progress. They can then open the form back up and fill out until they mark it as Completed, which will then trigger an alert.
So basically, I need to show a regular List choice column within the dialog box when they press save.
Is this possible?
-
December 4, 2014 at 18:22 #6707
Sorry for the delay. This is not possible without custom making a dialog. In the example you have an ok or cancel button, and you can use them to set a field value for OK and another for Cancel. Here is an example on how to set the value:
setFieldValue("FieldNameHere","value you want to set");
Hope this helps,
Alexander -
December 4, 2014 at 20:50 #6709
Would it be possible to add another button to the dialog box at the bottom that would accomplish this functionality then? So next to the default “Save” and “Cancel” buttons, there would be another button that would be “Final Save”. The “Final Save” button would have the exact same functionality as the normal “Save”, but it would also change an additional Choice column (titled “Final Save”) to “Completed”.
Is this possible?
-
December 7, 2014 at 09:47 #6714
This is possible. Add this code to the custon JS in the Misc tab:
(function(){ var b = [""]; b.push("<td class='ms-toolbar' nowrap='nowrap'>"); b.push("<input type='button' class='ms-ButtonHeightWidth' value='Final save' onclick='finalSave();' />"); b.push("</td>"); b.push("<td class='ms-separator'> </td>"); $("input[id$=diidIOSaveItem]:last").parents("table:first").parents("td:first").before(b.join("")); })(); function finalSave(){ setFieldValue("YourFieldInternalName","Completed"); $("input[id$=diidIOSaveItem]:last").click(); }
You must change the “YourFieldInternalName” in the finalSave function.
Alexander
-
December 8, 2014 at 17:26 #6718
(function(){ var b = [""]; b.push("<td class='ms-toolbar' nowrap='nowrap'>"); b.push("<input type='button' class='ms-ButtonHeightWidth' value='Final Save' onclick='finalSave();' />"); b.push("</td>"); b.push("<td class='ms-separator'> </td>"); $("input[id$=diidIOSaveItem]:last").parents("table:first").parents("td:first").before(b.join("")); })(); function finalSave(){ setFieldValue("FinalSave","Completed"); $("input[id$=diidIOSaveItem]:last").click(); }
I have added this to the Custom JS and attached is what it displays on the screen.
Attachments:
-
December 8, 2014 at 18:43 #6721
Sorry, I got it to work now. Thank you for all your help!
-
-
AuthorPosts
- You must be logged in to reply to this topic.