Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable the browser's print button

Status
Not open for further replies.

desiana

Programmer
Oct 31, 2001
23
0
0
MY
I am currently doing a program using JSP.In my program I have a print button
which does a function other that printing. That is why I want to restrict
users from clicking on the browser print button. I have thought of three
possible things that I can implement, i.e :
1. Disable the browser's tool bar
2. Keep track when users click the print button in the tool bar.
3. Pop up another window without the tool bar.
But the poblem is I don't have any idea of how to do those things.
Can you help me on this ?? Do you think those I mentioned are possible
to be done ? If yes, then how to do that ? Thanks
 
I am doing a program in JSP now. What I want to do is : when user click a button, a pop up window will be displayed and the problem is how to pass values from the main window (the window in which the button is located) to the pop up window ? Usually, I use request.getParameter() to get values from another window, but it didn't work for pop up window. Thanks for your help.
 
Are you using something like: window.open("url", "name", "atts"); to create the pop-up? If so, then you can simply append the parameters to the url string e.g. myUrl.jsp?paramOne=testingOne&paramTwo=testingTwo
These would then be available to the jsp containing in the pop-up via the req
However, if you just want to pass the values client-side, (e.g. to a script function on the pop-up), then you could just make them available as global variables on the invoking page and the the invoked page could call window.opener.theVariableNameThatYouWantToAccess.
Does that help?
 
Is there a way to hide the value being passed to the pop up window ? Because if I use "myUrl.jsp?paramOne=testingOne; paramTwo=testingTwo", I can see on top of the pop up window what paramOne and paramTwo values are. Since I am passing username and password, I don't want it to be seen. Any idea of how to do that ?
 
If you turn off the address bar on the popup window then the url will be hidden from view?
 
how to turn off the address bar ? what command should I use ?
 
Well, the command to open the window is a jm99 said. Under the attributes part you can put any of the following, there are more than this but these ones define which bits of the window are displayed.


locationbar Yes/No Whether the address bar is displayed

menubar Yes/No Whether the menu bar is displayed

personalbar Yes/No Whether the personal icons bar is displayed

scrollbars Yes/No Whether the window has scrollbars

locationbar Yes/No Whether the address bar is displayed

statusbar Yes/No Whether the statusbar is displayed

toolbar Yes/No Whether the toolbar is displayed


As I said there are more but I hope this helps.

Robert Miles


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top