Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

BBS: Re: How do I print generated text? - July 03, 1998 at 20:38:05

You are here: irt.org | BBS | Re: How do I print generated text? [This BBS is closed]

Posted by Robert Skipper on July 03, 1998 at 20:38:05:

In Reply to: How do I print generated text? posted by Robert Skipper on July 03, 1998 at 17:11:50:

I should have said I'm working in JavaScript.

I should also have given the relevant code. So here it is:


<HEAD>
<SCRIPT LANGUAGE="JavaScript">

function show_tablet () {
var p = window.open ('', 'print_window',"width=400,height=400,scrollbars,menubar");
var d = p.document;
var c = document.forms['notebook'].tablet.comments;
d.writeln ('<HTML><HEAD></HEAD><BODY><CENTER><H2>Notes</H2><HR width=70%></CENTER>');
for (var i=0; i<c.length; i++) {
d.writeln (c[i] + ' }
d.writeln ('<HR>'+'<FONT SIZE=-1><EM>Student notes generated by CT.</EM></FONT>'+'<BR>');
d.writeln ('<SCRIPT LANGUAGE="JavaScript">');
d.writeln ('document.write (\'<FORM><INPUT TYPE=\"BUTTON\" VALUE=\"Print\" onClick=\"this.print ()\"></FORM>\');');
d.writeln ('</SCRIPT>');
d.writeln ('<BR></BODY></HTML>');
return false;
}
.....

</SCRIPT>
</HEAD>

<BODY>

//Lotsa stuff here.

//Then

<FORM method="post" NAME="notebook" action="">
<textarea wrap="soft"
// Blah-blah-blah
>
</textarea><BR>
<SCRIPT LANGUAGE="JavaScript">
document.forms['notebook'].tablet.mode = 'listen';
show ("Listening for messages");
document.forms['notebook'].tablet.comments = new Array ();
</SCRIPT>

//Other buttons here.
<INPUT TYPE="button" VALUE="View Notes" onClick="show_tablet ();"}>
</FORM>

Follow-ups:

You are here: irt.org | BBS | Re: How do I print generated text? [This BBS is closed]

©2018 Martin Webb