Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 21 FEB 2021 12:37:44PM BrianWick wrote:

I see an old post going back 10 years.

But today - As part of the First O4W page being brought up - is there a way to disable the "Back" button.


At 22 FEB 2021 08:02AM bshumsky wrote:

I see an old post going back 10 years.

But today - As part of the First O4W page being brought up - is there a way to disable the "Back" button.

Hi, Brian. The back button _where_? Using which O4W tool - the form wizard, the report wizard, a custom stored procedure? On which platform - desktop? Mobile?

- Bryan Shumsky

Revelation Software, Inc.


At 22 FEB 2021 08:06AM D Harmacek wrote:

Assuming you mean the Back button of the browser, I'd write some javascript into the O4W template.

Dave Harmacek - Harmacek Database Systems - near Boston, MA USA


At 22 FEB 2021 03:58PM BrianWick wrote:

O4W 9.4.6.

I use all the standard browsers - and currently - just an android device.

I don't do anything in javascript - I just make calls to whatever plugins are available in O4W.

real simple what I am doing:

Everything runs in my world of O4W_FORMBUILDER except when I do a redirect from that (to the same page NOT _blank) to O4W_PICKER which then does a redirect back to O4W_FORMBUILDER with whatever data, key or whatever is Picked.

And when the user gets confused or for whatever reason leans on the back butoon he will end up at a previous picker screen and then a previous formbuilder and start pressing buttons.

I am looking for the easy fix rather than trying wade through whatever old buttons are still on those previous expired pages.

tx


At 23 FEB 2021 06:59AM bshumsky wrote:

Hi, Brian.

As Dave has suggested, if you want to globally restrict the usage of the browser's back button, you can add something into your "template" (the HTML document that your O4W uses to "wrap" all the dynamic content). If you google "How to disable browser back button", you will see a number of responses. For example (NOT TESTED):

If you put the following snippet in the <HEAD> section of your template, it should stop the back button from working. If you edit the template you're using, you'll find a section of text that starts with <HEAD> and ends with </HEAD>. Somewhere in there, add in the following:


<script type="text/javascript" >

   function preventBack(){window.history.forward();}

    setTimeout("preventBack()", 0);

    window.onunload=function(){null};

</script>

Save your updated template, and reload your page(s), and it SHOULD stop you from using the back button (again, I haven't tested this solution - but if it doesn't work, you can find literally dozens more on the internet…)

- Bryan Shumsky

Revelation Software, Inc.


At 23 FEB 2021 11:48AM BrianWick wrote:

Hi Guys -

thanks for the help.

I have found that two COMBINED disable scripts are needed in order to 'completely' disable the browser back button in firefox, chrome and android.

<script type="text/javascript">

  history.pushState(null, null, location.href);
  history.back();
  history.forward();
  window.onpopstate = function () { history.go(1); };

</script>

<script type="text/javascript" >

 function preventBack(){window.history.forward();}
  setTimeout("preventBack()", 0);
  window.onunload=function(){null};

</script>

EDGE had mixed results.

in any event i am going to consolidate by O4W_PICKER into my O4W_FORMBUILDER and therefore only have ONE O4W_???? therefore fixing everything - whether the back buttom is enabled or disabled.

thanks again

bri

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/dcb1c43a84bb1b4ea89fafa9da1b0cd9.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1