Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Serverlet/JSP

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ,
IS there any way of disabling browsers back button using JSP or Servlet code?. Any tricks in HTML?
regards
Holla
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
calling a javascript function using Loaction.replace() method disables the back button althought it doesnt appear to us as though its disabled but using the below function you can check it up:
<html>
<head>
<SCRIPT>
function displayCatalog()
{
var seaName="" ;
var catName="" ;
for (var i=0; i < document.catalogForm.season.length; i++)
{
if (document.catalogForm.season[i].checked)
{
seaName=document.catalogForm.season[i].value ;
i=document.catalogForm.season.length;
}
}
for (var i in document.catalogForm.category)
{
if (document.catalogForm.category[i].checked)
{
catName=document.catalogForm.category[i].value;
i=document.catalogForm.category.length ;
}
}
fileName=seaName + catName + ".html" ;
location.replace(fileName)
}
</SCRIPT>
<FORM NAME="catalogForm">
<B>Which catalog do you want to see?</B>
<P><B>Season</B><BR>
<INPUT TYPE="radio" NAME="season" VALUE="q1" CHECKED>Spring/Summer<BR>
<INPUT TYPE="radio" NAME="season" VALUE="q3">Fall/Winter
<P><B>Category</B><BR><INPUT TYPE="radio" NAME="category" VALUE="clo" CHECKED>Clothing<BR>
<INPUT TYPE="radio" NAME="category" VALUE="lin">Linens<BR><INPUT TYPE="radio" NAME="category" VALUE="hom">Home & Garden
<P><INPUT TYPE="button" VALUE="Go" onClick="displayCatalog()">
</FORM>
</html>
 
Poornima Shetty
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raghu,in the above code when you check it up ,though in the beginning you start from the catalog page... when you click on go and navigate to the next page
,you can observe that now onclick of back button you cant come back to the catalog screen again.
 
Raghavendra Holla
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks poornima. But if java script disabled, this won't work. I don't know there is any HTML tag or meta tag which does this.
regards,
Holla.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Poornima Shetty:
Raghu,in the above code when you check it up ,though in the beginning you start from the catalog page... when you click on go and navigate to the next page
,you can observe that now onclick of back button you cant come back to the catalog screen again.


hi,
i tried to use the HTML code but it doesnt disable the back button..
suggestions pls..

 
I promise I will be the best, most loyal friend ever! All for this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic