Thanks to everyone who dissuaded me from the Javascript no-back-button solution.

It turned out that there was a coding error which only showed up when the user hit the back button. My script stores a CGI.pm query object on Page 2 and then retrieves and deletes it on Page 3.

However, users who hit the back button on Page 3 to return to the form on Page 2 and then resubmitted got an error, because some of the CGI variables stored in the CGI query object no longer existed.

The proper solution turned out to be to check that a stored query object exists, and provide the user with a helpful warning message if it does not. The advantage of this approach is that the browser's back button still works the same way as it always does, and the user knows what is going on.


In reply to Re: How To Disable A Browser's Back Button in CGI.pm? by sierrathedog04
in thread How To Disable A Browser's Back Button in CGI.pm? by sierrathedog04

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.