Hi Divya!
On Mon, 03 Apr 2000, Divya M A wrote:

> Hello!
>     Is it possible to disable the browser back button( using Javascript,
> etc.)? Or atleat force execution of a user's function on click of browser
> back button? The problem is that I have a file on submit of which, I get a
> second file. But I don't want the user to resubmit the first file, by
> entering into it using the browser back button. Is setting a flag and
> checking it each time one enters the file, the only alternative.
> Thanx
> Divya.
 Hi, although it's not related to JSP :-) this is how I would do it:
 * either have two frames , one very thin (hidden).
   The frameset (top) will act as container.
   1. add onSubmit() event handler to the form.
          When the user submits, set a flag in the top frame (which
          will persist after page change)
          return false from it to abort submission
   0. :-) on page load, generate  dinamically the submit button
   i.e.
     <script>
                if (top.flag == false) {
                        document.writeln ("<input type='submit' value='Upload'>")
                }
         </script>
         So the user will see no submit button (although the submit
         still works ).
 * set a cookie with your state, take actions according to it

 But, all this are in vain if s/he has disabled JS.

 -- teodor

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to