View Full Version : print and send button in one..
techker
04-15-2010, 12:17 PM
Hey guys i have a credit form on my web site and i currently have 3 buttons reset-print-send..
so whats happaning now is the the client only prints it and closes the window..so i never get it (stores in database)
is it possible to make a submit button that would send the script but at the same time trigger a print cmd?
in php
BLiZZaRD
04-15-2010, 09:52 PM
Not that I have seen, but what you can do is make the send button say on it "print preview" or similar, and have the headers send it to another page that echos the same information but maybe without the graphics or something.
That button before running headers, sends info to you. There is no print button on this page. Then you put the print button on the second page.
techker
04-15-2010, 09:55 PM
hmm true..
BLiZZaRD
04-15-2010, 09:57 PM
Not saying your method can't be done, I just haven't seen it done, and a quick search turns up nada.
djr33
04-15-2010, 10:07 PM
It's not possible to do two things at once.
There are two ways to make this work.
1. Submit the page and on the loaded page trigger it to print (you can output a copy of the form). You can use Javascript to trigger it to print when the page loads.
2. Use AJAX to dynamically submit the form (without reloading it). This is complex, but possible.
REMEMBER-- both of these rely on Javascript and some users may not have it enabled. Therefore, it is a much better idea to use idea (1) because printing is not crucial and saving the data IS crucial.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.