/    Sign up×
Community /Pin to ProfileBookmark

Please help me with this script!

This is my setup. I would love to be able to
print a form with a button while on a parent page. But, I’ve been told
that that cannot occur. So, I have a parent page that has selections in
a drop-down menu. One of the choices is to print an order form. A small
pop-up window comes up that contain a button. “Click” the button the
pop-up closes, a small window containing the form pops up, and a print
alert pops up. At the completion of the print the window is supposed to close
automatically. And believe it or not it actually worked; on my machine.
But when I up-loaded it, things stopped working. The ONLOAD tag has a
timeout that is supposed to close the window but does not. Is there
another string that can be used, like “onPrint.close” or something like
that? Here is the script from the pop-up page, and the form I want to
print:

<p style=”margin-top: 0; margin-bottom: 0″>

<a
href=”http://www.elizabethstewartclarkandcompany.com/Admin/A3/B/OF/GOF.h
tm”
onclick=”window.open(this.href, ‘child’,
‘height=100,width=100,TOP=0,LEFT=0’); window.close(); “>

<INPUT TYPE=”button” VALUE=”Print Order Form !”></a></p>

<p style=”margin-top: 0; margin-bottom: 0″>
—————————————————-

<HEAD>
<SCRIPT LANGUAGE=”JavaScript”>
<!– Begin
function printPage() {
if (window.print) {
agree = confirm(‘Elizabeth Stewart Clark & Company Order-by-mail. nn
“Click” OK to print now.’); if (agree) window.print();
}
}
// End –>
</script>

</HEAD>

<BODY OnLoad=”printPage(),setTimeout(‘window.close’,1000)”
bgcolor=”#FFFFFF”>

These are all of the pertinent areas, I think. I would really appreciate
it if you would take a look at this for me. Thank you for your help!

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliNov 13.2003 — No there is no onprint.close() function.

make sure that your timer is coded properly,if you use NS6+ or mizilla based browsers you can see the error in the javascript Console.
Copy linkTweet thisAlerts:
@AdamBrillNov 13.2003 — You could try taking a look at the attached code and see if that will work for you. It will print whatever is inside the print_text() function. You can use either plain text or HTML and it should work.

I hope that works for you. ?

[upl-file uuid=84243f42-a5b8-4136-b1dd-7f5ccad19263 size=620B]print.zip[/upl-file]
Copy linkTweet thisAlerts:
@D_S_R_ClarkauthorNov 13.2003 — I tried to open the document you gave me, but it appears to be corrupt.

I would like to see it.

Thank you?
Copy linkTweet thisAlerts:
@AdamBrillNov 13.2003 — It worked fine for me to unzip it with both winzip and winRAR... What did you try using?

I even tried on a different computer just to make sure and it worked fine.
×

Success!

Help @D_S_R_Clark spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...