Redirect To A Custom Page After Completing A List Form



  • As we know, Sharepoint make us easy let the end user populate a list with data though List Forms.

    These are out-of-the-box features that Sharepoint design for us.

    Well, using these Forms I came across with the fact that after submit the form, Sharepoint redirect you to the List that the form belongs to.

    This is a problem. Generally we don't want the user read the information on this list.

    So, how can we avoid it and redirect the user to a custom page?.

    Go to the page where you have placed the List Form.
    At the end of the Url you will have to add the following Query String.
     

    • ?Source=%2F Containing Folder%2FPageName%2Easpx&RootFolder=

    Note that the query string is basically the url of our custom page, using '%2F' instead '/' and '%2E' instead of '.' .



    You will se that after submit this form you will be redirected to you custom page.

    So, what remains for us to do is add the query string to the link that calls the page. For example:



     

    NOTE: You will find on internet different solutions to do this same thing, for example, replacing the 'save' button with this Input control:

    <input type="button" value="submit" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={}')}" />

    This input seems to work, but when you add validators to the fields, it fails to check the conditions before to redirect you to the custom page.


  • Comments



Add a Comment