Small Help for Humanitarian Training Center
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Small Help for Humanitarian Training Center

From: Chris-n-Jordan <chris@servicepartners.org>
Date: Sun Nov 13 2005 - 17:36:40 CET

Greetings all,

I wonder if I might be able to get a small amount of help for our
non-profit English Training Center
(http://www.servicepartners.org/jordan). I have a computerized level
test for our center that I need to slightly modify. Unfortunately, I am
a javascript NOBODY and don't have any experience scripting things.

 Basically, when a student takes a level test at our center, the last
page of the test has an option to print the test. I would like to
remove the print button and make the printing automatic when the page
is loaded. I have a default printer loaded on all of the testing
computers, so I just need it to send the print doc to the default
printer, preferably without user intervention or a print dialog box.

I would also like to see if there is an easy way to have the test
program save a copy of the same page that it prints. I have a variable
I have found called username, I wonder if it could be used to name a
unique file. (CODE FOR USERNAME IS: var c886 = [[], ["User Name"], [],
[], [], []];)

Here is the code below that contains the print commands.

c534 += '<p><font size="-2"><i>Started: ' + c233(c911) +
'</i></font></p>';
c534 += '<p><font size="-2"><i>Ended: ' + c233(c594) +
'</i></font></p>';
if (c399[0] == 1) c534 += '<p>Use the slider to review your answers to
the questions.</p> ';
c534 += '<form name="qtbuttons"><p>';
if ((c399[1] == 1) && (window.print)) c534 += '<input type="button"
style="width:150px;" value="Print" onClick="window.print();"> ';
c534 += '<br><input type="button" style="width:150px;" value="Back"
onClick="parent.history.back(); parent.history.back();"> ';
c534 += '</p></form>';
c534 += '<hr width="80%">';
c534 += '<table border="0" cellpadding="0" cellspacing="0"
width="300"><tr><td>';
c534 += '<img src="buttons/owl.gif" width="80" height="72"
border="0">';
c534 += '</td> <td><div align="center">';
c534 += '<p><font size="-1">Question Tools</font></p>';

One website I visited suggested the following code to print without a
print dialog box, but I was not able to insert it and have it work
correctly.

Thanks for your help in advance!
Received on Mon Nov 21 03:27:42 2005