Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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)?

irt.org | Knowledge Base | JavaScript | Print | Q1132 [ previous next ]

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)?

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)?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.