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

Q1132 When I am printing a window which contains a form, is there any way for some of the form elements be not printed (like buttons)?

You are here: irt.org | FAQ | JavaScript | Print | Q1132 [ previous next ]

In Netscape Navigator 4+ you could (optionally) output form fields to the document using something like:

<script language="JavaScript"><!--
var printing = false;

if (document.layers && (self.innerHeight == 0 && self.innerWidth == 0)) printing = true;
//--></script>

<form>

<input type="text">

<script language="JavaScript"><!--
if (!printing)
    document.write('<input type="button" value="Click Me" onClick="alert(\'Hello World\')">
//--></script>

</form>

Feedback on 'Q1132 When I am printing a window which contains a form, is there any way for some of the form elements be not printed (like buttons)?'

©2018 Martin Webb