5

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 2

5

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>
3
  • 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
    – naijacoder
    Commented 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. Commented Jul 28, 2011 at 11:59
  • Worked great for me. Thanks for providing this solution!
    – user11395
    Commented Oct 16, 2012 at 22:27
3

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));
}
3
  • 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?
    – samolpp2
    Commented Oct 28, 2015 at 8:52
  • 1
    try 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
    – Shawn
    Commented Oct 30, 2015 at 0:09
  • it worked. But I am not able to mark your reply as answer.Can you tell how to mark?
    – samolpp2
    Commented Nov 5, 2015 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.