Printing the Page and Executing the Form action With One Click.

F

Fred

How would you configure a submit button
<input type="submit" name="Submit" value="Submit"> button
So that when clicked it sends to the action and also prints the page
with the form at the same time?

I've been trying this JavaScript but I'm having trouble with it.

<script language="JavaScript">
<!--
if (window.print) {
document.write('<a href="#" onClick="javascript:window.print()">' +
'<img src="button_print.gif" width="241" height="22" border="0">' +
'</a>');
}
// -->
</script>


Thanks for the help.
 
B

Beauregard T. Shagnasty

Fred said:
How would you configure a submit button <input type="submit"
name="Submit" value="Submit"> button So that when clicked it sends to
the action and also prints the page with the form at the same time?

How will you know that your visitors have a printer turned on, or even
if they *have* a printer associated with their surfing device?

I don't think I have seen a cell phone or a PDA with a printer on it
yet. My desktop PC only has a printer engaged when I want to print
something, and my laptop never has a printer attached.

What will be the ramifications if someone cannot print this page? Say
someone who has JavaScript disabled?

Can you explain just why you want to do this?
 
F

Fred

How will you know that your visitors have a printer turned on, or even
if they *have* a printer associated with their surfing device?

I don't think I have seen a cell phone or a PDA with a printer on it
yet. My desktop PC only has a printer engaged when I want to print
something, and my laptop never has a printer attached.

What will be the ramifications if someone cannot print this page? Say
someone who has JavaScript disabled?

Can you explain just why you want to do this?


I know, its a funky request but my client wants it and if they want it
they get it.

I'll have the form parser return a page asking if it worked. I dunno.
 
L

Leonard Blaisdell

Fred said:
I know, its a funky request but my client wants it and if they want it
they get it.

Sometimes one ends up with want in one hand and sh*t in the other. Many
people with laptops access the Internet without a printer while away
from the office. Some leave their printer turned off until they need it
for power saving reasons, rational or not.
I'll have the form parser return a page asking if it worked. I dunno.

If it doesn't, was filling out the form a waste of their time? I'd be
annoyed at best if I submitted a form and my printer fired up. That
should be my option, not the websites. At best, I'd offer up the
completed form asking for it to be saved for printing. Or an automated
email confirmation to their email address.
I'll be interested to see if it's possible. I've never had it happen to
me, but Perl, PHP and browser tricks might make it possible for some
people. But deep down, I doubt it.

leo
 
A

Adrienne Boswell

I know, its a funky request but my client wants it and if they want it
they get it.

Tell you client nicely to stop wanting that, and give the reasons others
have said.

What you might want to do, however, is create printing styles (not a
separate page), so the user does not get what is not needed, eg. navigation
(you can't navigate a piece of paper).

@media print {
#menu {display:none}
}
 
T

Travis Newbury

Beauregard said:
I don't think I have seen a cell phone or a PDA with a printer on it
yet...

Not to take away from your point, but both my cell phone and PDA have
print capabilities.
 
B

Beauregard T. Shagnasty

Travis said:
Not to take away from your point, but both my cell phone and PDA have
print capabilities.

Just this morning I affixed a wide shoulder strap to my 49lb NEC laser
printer... :)
 
B

BootNic

Fred said:
On Tue, 31 Jan 2006 18:24:27 GMT, "Beauregard T. Shagnasty"
[snip]
I know, its a funky request but my client wants it and if they want
it they get it.

I'll have the form parser return a page asking if it worked. I
dunno.

My opera can not submit a form if its been printed, or given the option to print. Does not matter if its done with JavaScript or with opera. It simply takes opera out.

I do not know if this is a local event or if its a bug.

I would hate to think I would not be able to submit a form after taking the time to fill it out.

--
BootNic Wednesday, February 01, 2006 9:46 AM

Laughter sets the spirit free to move through even the most tragic of
circumstances. It helps us shake our heads clear, get our feet back
under us, restoring our sense of balance and purpose. Humor is
integral to our peace of mind and to our ability to go beyond
survival.
*Captain Gerald Coffee POW in Vietnam for seven years*
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top