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

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>
  • 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 Jul 28 '11 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. – Eric Alexander Jul 28 '11 at 11:59
  • Worked great for me. Thanks for providing this solution! – user11395 Oct 16 '12 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));
}
  • 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? – SaMolPP Oct 28 '15 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 Oct 30 '15 at 0:09
  • it worked. But I am not able to mark your reply as answer.Can you tell how to mark? – SaMolPP Nov 5 '15 at 11:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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