Prevent Use of the Back Button (in IE)

前端 未结 15 1959
囚心锁ツ
囚心锁ツ 2020-11-27 21:16

So the SMEs at my current place of employment want to try and disable the back button for certain pages. We have a page where the user makes some selections and submits the

15条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-27 21:51

    Because of the security isolation of javascript in the browser, you cannot change what the back button does.

    Perhaps you could store something in the user's session that indicates that a comment is needed, and have any page in the app that the user tries to load redirect to the comment page?

    What if the user closes their browser when he/she gets tot he comment page?

    I know that you have not been given a choice here, but since what they are asking for seems to be impossible...

    Perhaps you could just not consider the item as completed until the user enters comments. Thus, you would need to keep track of both in-progress items and completed items, and make that distinction in the UI, but this might be the most robust method.

    Or just put the comment field on the form page?

提交回复
热议问题