Redirected page in embed web part opens at the bottom of the iframe.

matt howell 351 Reputation points
2022-01-25T16:26:05.04+00:00

To redirect users to a simple confirmation page after they submit an item to a list, I'm iframing the newform.aspx page in an embed web part and using the ?Source= url parameter like this :

https://xxx.sharepoint.com/sites/xxx/Lists/xxx/newform.aspx?IsDlg=0&Source=https://xxx.sharepoint.com/sites/xxx/SitePages/xxx.aspx#top

The redirect works fine but always opens at the bottom of the iframe so the confirmation message at the top of the page isn't visible unless users scroll up. I tried adding a named anchor to force the iframe to open at the top but that is disregarded. Is there any way to correct this aberrant Sharepoint only behavior?

Microsoft 365 and Office | SharePoint | Development
Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

2 answers

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2022-01-27T09:38:37.15+00:00

    Hi @matt howell ,
    You can try to scroll up to top when onload the page. Please refer to the following code.

    168957-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



  2. matt howell 351 Reputation points
    2022-02-07T14:38:30.887+00:00

    No it hasn't. The page with the iframe on it is a modern page so I can't add anything there to force the iframe to open the target page at the top.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.