Print This Page Button

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • davidlee9
    Sergeant

    • Feb 2006
    • 26

    Print This Page Button

    How can I add a "Print This Page" button to a form?

    David
  • Collectors-info
    General

    • Feb 2006
    • 8703

    #2
    Re: Print This Page Button

    Hi, try popping the script below in a html box & preview. Should be like the one on this page as a sample. LINK

    Code:
    <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>');        
    }
    /*
    This script is written by(www.webbiesite.com)
    Use, visit dynamicdrive.com
    */
    </script>
    Regards Chris.

    Collectables, Collecting, collectors-info.com

    www.chrismorris.co.uk

    House build project

    Comment

    • davidlee9
      Sergeant

      • Feb 2006
      • 26

      #3
      Re: Print This Page Button

      Dear Chris:

      I tried your suggestion and it works except I get extraneous stuff. See:



      Any suggestions?

      David Lee
      davidlee9****.com

      Comment

      • Rob (SA)
        Lieutenant Colonel

        • Nov 2006
        • 586

        #4
        Re: Print This Page Button

        Hi Folks,

        I have already created a thread after much reading of other threads but just maybe this thread would be able to offer reply.

        As you have got the page to print this page in its completed form. Is there now a way one may receive the same by using a submit button?
        Kind Regards
        Rob
        www.gnjgf.co.za
        www.oryan-projects.com

        Comment

        • Collectors-info
          General

          • Feb 2006
          • 8703

          #5
          Re: Print This Page Button

          Hi, if you need to print just an area of a page/form, you have 2 choices.
          1. create a page with just the text & form elements you want on it & direct a visitor to this page. (Or a pop up)
          2. Or place the newly created page as above with text & form in to an iframe. with a print button on the iframe page.

          Hi Rob, if you are thinking of receiving an email & the visitor getting a print out? You might have to ask Naval if this is possible. (Not sure myself) But i cant see a reason not to have just 2 buttons. Set the page up as a normal form for emails with a submit button. Then just add a print button as well. (Just an idea)

          Good luck.
          Regards Chris.

          Collectables, Collecting, collectors-info.com

          www.chrismorris.co.uk

          House build project

          Comment

          • Rob (SA)
            Lieutenant Colonel

            • Nov 2006
            • 586

            #6
            Re: Print This Page Button

            Hi Chris,

            Thanks for speedy reply.

            The page is much as you say it.

            http://www.gnjgf.co.za/domtour.php is an entry form that I would like to receive on completion by the entrant using the option of "submit" rather than currently complete, print, sign and fax so as to get it to me.

            I f you guys in this thread could get the page to print then maybe it is just a script that needs some tweaking in order it can be mailed?

            Thanks again for your advice
            Kind Regards
            Rob
            www.gnjgf.co.za
            www.oryan-projects.com

            Comment

            • Collectors-info
              General

              • Feb 2006
              • 8703

              #7
              Re: Print This Page Button

              Hi Rob, i would leave your form page as it is & just knock up another page with only what you want to print & put a link on the form page to a printable version. When they click on this, a popup with the form on will appear with a print button. Bit like this page, but in a pop up style.
              The nice thing about this is you can ask them to fill the form in & then print it out for signing & posting via mail.
              Regards Chris.

              Collectables, Collecting, collectors-info.com

              www.chrismorris.co.uk

              House build project

              Comment

              • navaldesign
                General & Forum Moderator

                • Oct 2005
                • 12080

                #8
                Re: Print This Page Button

                I believe that ROB is reffering to recieving an email, with the form layout as it is in the page, and already filled in with the users details. This is possible, but only with custom coded html email. Easy to do, hard to explain. It requires (depending on the form complexity) 3 - 4 hrs of work.
                Navaldesign
                Logger Lite: Low Cost, Customizable, multifeatured Login script
                Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                Comment

                • Rob (SA)
                  Lieutenant Colonel

                  • Nov 2006
                  • 586

                  #9
                  Re: Print This Page Button

                  Hi George,

                  I hope you are keeping well.

                  You are correct in that i do want to recieve it via email which for those that know is easy.
                  1. I enquire why it is called a "coded" html and not just an html?
                  2. Once this html coded or not is created would I be able to read it learn form it and develop other such pages on my own - not being as programe minded and fleunt in the respective languages?
                  3. If there is a way in which I can learn to do it I would appreciate some guide lines if that is not to much of a problem?
                  I look forward to your responses
                  Kind Regards
                  Rob
                  www.gnjgf.co.za
                  www.oryan-projects.com

                  Comment

                  • navaldesign
                    General & Forum Moderator

                    • Oct 2005
                    • 12080

                    #10
                    Re: Print This Page Button

                    Basically, you need to know html and php coding. It has to be coded html means that this is not a html email that you can create with a html editor: it needs to merge the php data sent by the user in the html code. The reult is html, with the actual values that the user sent. This html code is then sent as email.

                    I am not sure if you can learn how to do it, it is rather complicated. Sure you can if you have the time. Teach you ? a bit difficult.

                    Guidelines: any html email tutorial on the net. After you have learnt how to create html emails, you need to learn how to do it with PHP (because you will have to insert php values in the html code). Last you need to send this html email, which cannot be done with the scripts that you can find here on the forum, but can be done with many other scripts that you can find on the net.
                    Navaldesign
                    Logger Lite: Low Cost, Customizable, multifeatured Login script
                    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
                    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
                    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

                    Comment

                    • Rob (SA)
                      Lieutenant Colonel

                      • Nov 2006
                      • 586

                      #11
                      Re: Print This Page Button

                      Hi George,

                      Thanks for the good news. I am glad I can now look at n option to get this to work.

                      Some things I would like you to consider in preparing a quotation for me are:
                      1. Some data needs to be changed periodically and I would like to be able to access it to make such changes myself.
                      2. The data (inputs) from this form will ultimatly be directed to a data base.
                      3. If I change the look of the page the basics (the html) does not differ.
                      I am sure other details can be sorted later. Please direct your quote to the email previously used. Failure to that use the feedback form on my website to make contact via email
                      Kind Regards
                      Rob
                      www.gnjgf.co.za
                      www.oryan-projects.com

                      Comment

                      Working...
                      X