I have a custome form i built from a list using SharePoint Designer. I would like a message to popup after the user has clicked the save button. I have played arounf with presaveaction but no luck. I don't want to redirect to a new page but e.g just an alert ot a jquery pop message to load. Thanks in Advance
2 Answers
PreSaveAction should work for you, something along the lines of this:
<script type="text/javascript">
function PreSaveAction() {
alert('Thank you for the submission');
return true;
}
</script>
-
Nope i want the popup to appear after the record has been added. Tried that before and when i use ur code every time i click on Save button i get the alert Jul 28, 2011 at 0:36
-
For that, I think you'd need some sort of event receiver. PreSaveAction does processing before the item is committed to the database. Jul 28, 2011 at 11:59
-
Worked great for me. Thanks for providing this solution!– user11395Oct 16, 2012 at 22:27
try the Notify object
var notifyId = null;
function Notify(msg, sec) {
notifyId = SP.UI.Notify.addNotification(msg, true);
setTimeout(function () {
SP.UI.Notify.removeNotification(notifyId);
notifyId = '';
}, (sec == null ? 1500 : sec));
}
-
the above code didn't work for me.Do I need to add the sp.js reference just like jQuery and spservices.js file ? on top of my Content Editor web part?– samolpp2Oct 28, 2015 at 8:52
-
1try this one in your code Notify('This is a test...',1000); , it should work. But I did noticed that after you change to 100 it won't come up– ShawnOct 30, 2015 at 0:09
-
it worked. But I am not able to mark your reply as answer.Can you tell how to mark?– samolpp2Nov 5, 2015 at 11:30