• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

clear the field and disable the back button.

 
Rush Shah
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I need to clear the field when i navigate from one screen to other and disable the back button.
example; index.jsp--->servlet1;

problem1;

on index.jsp i have two field say x and y which takes number as input from user.
when i click on the submit button it goes to servlet1.when i click on back button the previously entered data is still visible in two field x and y.

i try the below solution for the same but it is not working.



i am using tomcat as server.is there any configuration required at server side?

problem 2;

how to disable the back button in browser?
i try the below solution for the same but it is not working.





please help me out.


 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34965
377
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rush,
Welcome to JavaRanch!

#1 - Are you using GET or POST to display X? If the later, the technique you described should work. However, you shouldn't use POST just to avoid the user going back. It results in an annoying website where one can't go back to anything and gives up. What's the harm in the user going back to that page.

#2 - This is easy. You can't disable the back button in any reliable way. it is a feature of the user's browser.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
 
Rush Shah
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky/Bear Bibeault thanks for the reply.

Problem 1 : I have try using both Post and Get the fields are not getting cleared.

Problem 2: secondly I have gone through the InterfaceDesignersRule1 ,
The requirnment in my application is
1)when user click on any screen using browser back button then it user must see 404 or error page

2)There is seperate back button provided in application using which only the
user can go back.

Please help me out for the above problems fix.








 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic