locked
Redirect page for anonymous users RRS feed

  • Question

  • I have a list form exposed to anonymous users. However, I need them to be redirected to a thank you page after they hit "Save" on the list form. Currently, it takes them to a blank screen. I've tried numerous javascripts and the &Source= solution but nothing works!!
    Tuesday, March 8, 2016 10:05 PM

Answers

  • Hi,

    I suggest you add the code below in the Content Edit Web Part in the EditForm page:

    <script type="text/javascript"> 
    
    function PreSaveAction()
    
    {
    
       window.location.href="https://www.google.com";
    
       return false;
    
    }
    
    </script>
    

    Thanks,

    Dean Wang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.


    Thursday, March 10, 2016 7:59 AM

All replies

  • Hi,

    Please check the link  below

    https://social.technet.microsoft.com/Forums/office/en-US/226a1161-6c6d-4283-92fb-b45416cc2360/redirection-for-anonymous-users?forum=sharepointgeneral

    https://social.technet.microsoft.com/Forums/office/en-US/ea0c5133-2286-40e9-bd4a-20e4ad79d360/redirect-page-layout-doesnt-work-for-anonymous-users?forum=sharepointadminprevious


    Please remember to click &#39;Mark as Answer&#39; on the answer if it helps you

    Tuesday, March 8, 2016 10:18 PM
  • None of these links help with a definite answer. Is lockdown feature responsible for this? It would be helpful if you could provide your opinion
    Tuesday, March 8, 2016 11:14 PM
  • Hi,

    If you want to customize the save button, you can use PreSaveAction function.

    A similar post about how to modify PreSaveAction function to redirect to other pages for your reference:

    https://social.msdn.microsoft.com/Forums/office/en-US/4a808734-6879-43f7-9e79-f6a03d49dfa8/redirect-from-newform-to-custom-page?forum=sharepointdevelopmentprevious

    You can add a condition to judge if the current user is an anonymous user.

    How to check user permission using SharePoint JavaScript Object Model for your reference:

    http://www.codeproject.com/Articles/678653/How-to-check-user-permission-for-the-web-list-or-S

    Thanks,

    Dean Wang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, March 9, 2016 9:42 AM
  • Hi can you please help with what I need to add to the Script Editor on NewForm.aspx? I am trying to add this but nothing happens.

    <script type="text/javascript">
    $(document).ready(function(){    
         $('input[value=Save]').click(function() {       
            window.location.replace("http://www.google.com");  
          });  
        });  
    </script>

    Wednesday, March 9, 2016 4:05 PM
  • Hi,

    I suggest you add the code below in the Content Edit Web Part in the EditForm page:

    <script type="text/javascript"> 
    
    function PreSaveAction()
    
    {
    
       window.location.href="https://www.google.com";
    
       return false;
    
    }
    
    </script>
    

    Thanks,

    Dean Wang


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.


    Thursday, March 10, 2016 7:59 AM