Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2012
    Thanked 0 Times in 0 Posts

    Is Refresh page button part of DOM

    Are the back button and the refresh button part of the DOM, and if so is it possible to disable them for a particular page? Anticipating the obvious question “why would you want to do that", I have a form into which which users enter data, which then posts the data to a new page which reviews the input, the data having been stored in a MySQL database. To edit the data there is a button to go to yet another page which then pulls the data from the MySQL database and allows the user to edit it. Despite the fact that the edit data button is large and there is bold text entreating the user not to use the back and refresh buttons, a significant number still do. This results in a 2nd record being placed in the database rather than editing the 1st.

    Maybe there is a better way round this problem as I am sure it is not unique to me?

    All clues greatly appreciated.
    A talent for speaking differently, rather than for arguing well, is the chief instrument of cultural change. Richard Rorty

  2. #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 932 Times in 919 Posts
    Quote Originally Posted by oddshoes View Post
    Are the back button and the refresh button part of the DOM, and if so is it possible to disable them for a particular page?
    No they are a part of the browser and therefore belong to your visitor, They are definitely NOT a part of your web page and so you have no control over the refresh button and very limited control over the back button (in that the back button goes back through the history list and you can load new pages that overwrite your prior history entry rather than adding a new one)

    The answer to any sentence containing both the word 'JavaScript' and the word 'disable' have the following two answers:

    1. No the author of a web page cannot disable it using JavaScript.
    2. Yes the owner of the browser can disable or override any JavaScript in any web page.
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts