Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

My back button isn't working. Help!  RSS feed

 
Darrin Smith
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to give my use a "back button" that acts like the back button on most browsers. In other words, add a button to a page and when the user clicks that button, the user will be sent back to the previous page just like if they clicked the back button on the browser.

To do this, I tried adding:



to the onClick event, but that didn't do anything.

My full page code looks like this:



What is it that I am doing wrong?

Note onClick is misspelled intentionally in the code snippet (I kept getting an error when it was spelled correctly even though it was inside a code block).
[ September 19, 2005: Message edited by: Darrin Smith ]
 
Darrin Smith
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, got it.

What I did was right, but for JSF you have to add return false;

So, my onclick looks like this:

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!