2

Where should i fit in a pop-up, using this existing piece of code?

<td>
  <input type="button" value="Save" name="btnFormAction"
         onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={https://abc-public.sharepoint.com}')}" />
</td>

I want a pop-up to confirm that "your stuff is saved" Before redirecting back to the start page. Thanks Sanna

1

Write the below code in a script editor webpart:

 <script type="text/javascript">

         function PostSaveAction(){ 
              alert("Your item is created!!");
              window.location = "http://www.yoururl.com";         
              return true;  
             }  
    </script>

This function is called after an item is created.

  • Can I use this with current code that is used for redirecting onclick event? – Sanna Wahlén Sep 7 '15 at 11:35
  • just call a function like the one which i mentioned in my previous answer. See edit history – Taran Goel Sep 7 '15 at 11:43
0

Define a click function on the save button and do something like this

$(".btn").click(function(){
   //execute operations for saving data
   alert("Changes Saved");
   //redirect the user
});

The alert function halts execution of the code until it's dismissed.

  • Thanks, I didn't get this to work. I have too little experience to know exactely how to fit this in and there were many errors trying this. – Sanna Wahlén Sep 7 '15 at 10:44
  • You might have missed jQuery's reference as far as the errors are concerned and you can add the above code in Content Editor WebPart. – Amit Sep 18 '15 at 13:05

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.