SharePoint: How to set up a pop up message in a list

SharePoint:
How to set up a pop up message in a list

Would you like to display a message to the user once they have selected Save in a SharePoint list.We will be performing this task using the javascript PreSave function in newform.aspx. Well this is how you do it.
Watch this how to video:
Potential Issue: If you have required fields in the form, the presaveaction() function will display pop up message regardless of required field. You will need to perform a validation for required fields. This will be a separate post later.



OR Follow these instructions:

Step 1: In SharePoint site, go to your list, then right-click Add New Item.

Step 2: Select Open in  New tab
 Step 3: Go to the newly opened tab and then go to Site Actions (Top Left) then select Edit Page.
Step 4: You will then select Add a Web Part




Step 5: Once you have selected Add a Web Part, at the top you will then select Content Editor, then click add.


Step 6: Select the new content editor, then at the top you will see <html> drop down menu, select edit html. 

Step 7: In the pop up text field is where the presave function will be filled in, please copy and paste this code in:

//////////////////////////////////Code//////////////////////////////////////////////////////////
<script type="script/text">
function presave() {
alert("You custom message goes here")
return true;
}
</script>
////////////////////////////////////////////////////////////////////////////////////////////////
Step 8: Select save/ok.
Step 9: Hide the web part by selecting the drop down arrow, select edit web part, the in the content editor, under layout tab, select check mark hidden, then select OK.

Step 10. Stop editing.


Testing:
To test, go back to your list in sharepoint.



Then fill out a quick form and select save.

You should have a pop up message after you have selected save.


Any suggestions please comment.
Dalibor

Comments

Popular posts from this blog

CS3150 Assignment 1

CS4500 Test 4 Study Guide

CS4150 Assignment 2