472,804 Members | 1,200 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,804 software developers and data experts.

how to open new (printer-friendly) window

Hi all

I have a php script that presents a rather simple form. After the user
filled in parameters and presses <submit>, the results from a postgres
database search follows on the page.

Now, if the user wishes to print the page, it'll be ugly containing
the form boxes. So one solution would be to present a
"printer-friendly" option on the page. Clicking there will present the
results in a new window free from the form boxes. I don't want to
repeat the database search in this new window, just "forward" the
variables to this new url.

I guess it could be done, but how?

Grateful for any help!
Jul 17 '05 #1
4 3647
Gandalf wrote:
Hi all

I have a php script that presents a rather simple form. After the user
filled in parameters and presses <submit>, the results from a postgres
database search follows on the page.

Now, if the user wishes to print the page, it'll be ugly containing
the form boxes. So one solution would be to present a
"printer-friendly" option on the page. Clicking there will present the
results in a new window free from the form boxes. I don't want to
repeat the database search in this new window, just "forward" the
variables to this new url.

I guess it could be done, but how?


Well, imho you should use CSS for this part...

Use "media" and include 2 stylesheets... one for the screen
(media="screen") and one for the print (media="print")

http://www.w3.org/TR/REC-CSS2/media.html

Regards,
johan

Jul 17 '05 #2
Gandalf wrote:

[snip]
Now, if the user wishes to print the page, it'll be ugly containing
the form boxes. So one solution would be to present a
"printer-friendly" option on the page. Clicking there will present the
results in a new window free from the form boxes. I don't want to
repeat the database search in this new window, just "forward" the
variables to this new url.


I guess the easiest solution to this problem would be to use an
alternative stylesheet which removes all the formatting. Linking this to
your document with the following statement would result in nice prints
with most browsers:

<link rel="stylesheet" type="text/css" href="print.css" media="print">

I know this isn't excactly the solution you asked for, but i recommend
you give it a thought.

--
Tormod Fjeldskår
to****@fritidsproblemer.no
http://tormod.fritidsproblemer.no/
Jul 17 '05 #3
Tormod Fjeldskår wrote:
Please check your date settings... or are you from the future? ;)

Regards,
Johan

Jul 17 '05 #4
Johan Holst Nielsen wrote:
Please check your date settings... or are you from the future? ;)


I'm terribly sorry! Did some time-related php-scripts and forgot to
return to the present ;)

--
Tormod Fjeldskår
to****@fritidsproblemer.no
http://tormod.fritidsproblemer.no/
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ben Smeets | last post by:
Hi folks, Have been trying to figure out a solution for the following problem by reading lots of threads here, but doesn't work out. Hope someone can help me. I have a parent window which...
1
by: Ed Brandmark | last post by:
I want to be able to open a window in the background of my page - without that flicker you see if you just open the window and then blur it (or focus the main window). The reason I want to do this...
3
by: ACaunter | last post by:
Hi all, I need to set a session variable and open a new window with a single click of an asp.net button. My problem is that it always takes two clicks.. one sets the session and the other opens...
1
by: Alessandro | last post by:
Hi ! There is a way to use a Linkbutton as an hyperlink? I want execute some code and then open a new window: if i use a linkbutton no new window will be opened, if i use an hyperlink i open new...
6
by: slacker | last post by:
In my jsp I have: <Script langauge="Javascript"> window.location.replace("first url"); window.close(); window.open("second url"); </Script> The child window opens from the parent window...
1
by: sathyanrockie | last post by:
Plase tell me what is the difference between window.open and window.showmodelessdialog. Can we use window.showmodelessdialog in place of window.open?
19
by: Sonnich | last post by:
Hi! I have used JS, but I am still new to it. I have something like this: oNewWindow = new Object(); oNewWindow = open("sonnich.xls","Qopen","resizable=yes,scroll=yes, status=yes,...
2
by: tshad | last post by:
I have an aspx window that is going to open a window (javascript) and display a graphic. I want to resize the window to the size of the graphic before it actually displays - how do I do that? ...
0
by: hcuellar | last post by:
Hi. Please I need your help for this: After a database query, a table is created with a cell for each information retrieved, and for each record, two buttons, and second one have besides it...
5
by: hcross | last post by:
This project is a web based html and Javascript site. I am working on mac at the moment. This script works except for attempting to open new window once complete. As you can see, i am new to...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.