building a printable form or page

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Lewis Forquer
    Private

    • Jun 2006
    • 2

    building a printable form or page

    how do I build a page or form that a customer can click on to print
    thanks
    lewis
  • Collectors-info
    General

    • Feb 2006
    • 8703

    #2
    Re: building a printable form or page

    Just make up a form that is under 800px wide & no longer than 1 printable page & add the code below into a html box for a print button. Sample form.

    <SCRIPT Language="Javascript">
    function printit(){
    if (window.print) {
    window.print() ;
    } else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
    document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
    }
    }
    </script>

    <SCRIPT Language="Javascript">

    var NS = (navigator.appName == "Netscape");
    var VERSION = parseInt(navigator.appVersion);
    if (VERSION > 3) {
    document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>');
    }
    </script>
    Regards Chris.

    Collectables, Collecting, collectors-info.com

    www.chrismorris.co.uk

    House build project

    Comment

    Working...
    X