• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

how to add back, print functions in a jsp page

Hi, I am currently designing a jsp pages.  I need to add two buttons in my page. One is a back button which will help me back to previous page, and one is print page which will print the current page. How to do that, thanks.
0
ly_uwo
Asked:
ly_uwo
1 Solution
 
pablomoralesCommented:
You need to use Javascript for that.

For printing:

<form>
<input type="button" value="Print this page" onClick="window.print()">
</form>

For the back button:

<script>
function goback() {
    history.go(-1);
}
</script>

<form>
<input type="button" value="Back" onClick="goback()">
</form>
0
 
ly_uwoAuthor Commented:
excellent, it helps a lot, thank you!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now