Announcement

Collapse
No announcement yet.

Printing Receipt Page - Handy Javascript Trick

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

    Printing Receipt Page - Handy Javascript Trick

    hi everyone, i found this neat trick at http://javascript.internet.com/messa...page-auto.html

    that automatically pops up a little box when someone hits your receipt page asking if they would like to print the page....

    it works neatly

    one thing to remember is that if you are adding it to an existing <body> tag, you need to do it this way..

    existing actinic body tag,

    <body NETQUOTEVAR:BGIMAGE "NETQUOTEVAR:ONLOAD" NETQUOTEVAR:BGCOLOR text="NETQUOTEVAR:FGCOLOR" NETQUOTEVAR:LINKCOLOR NETQUOTEVAR:VLINKCOLOR NETQUOTEVAR:ALINKCOLOR>

    and they tell you to insert

    <BODY OnLoad="printPage()">

    now because you already have a body tag there, you would naturally think that simply cutting out their OnLoad="printPage()" and pasting it into your actinic <body NETQUOTE etc> tag would be sufficient but you need to add a semi colon to seperate it from your existing onload statements from actinic

    OnLoad= printPage();

    so.... the proper way to add it to the actinic example above would be

    <body OnLoad= printPage(); NETQUOTEVAR:BGIMAGE "NETQUOTEVAR:ONLOAD" NETQUOTEVAR:BGCOLOR text="NETQUOTEVAR:FGCOLOR" NETQUOTEVAR:LINKCOLOR NETQUOTEVAR:VLINKCOLOR NETQUOTEVAR:ALINKCOLOR>

    we used to just make a print window hyperlink out of the word print...

    hurrah for well thought of javascrips...

    steve quinn
    harlequin domains
    www.harlequindomains.com
    0800 0832077
    Actinic Design, Hosting and Search Engine Optimisation

    #2
    Hi Steve

    Just found your post re printing...

    which file is this in, i have looked in order phase 3 and 4 but cannot find it.

    Cheers
    Steven

    Comment


      #3
      hi steve

      if you open actinic, and go to Design>Options> and choose the layout 'tab', you can see where it asks you which template to use for the receipt page, if you type in Act_ReceiptPrimary.html , and then click the edit button next to it....the correct page to add the code to (Act_ReceiptPrimary.html) opens up in notepad or your own editor.

      hope this helps..

      best,

      steve q.

      Comment


        #4
        Hi Steve

        THanks for that. Unfortunately id does not seem to work, the page loads but at the bottom left on the status bar it says error.

        I have played around with the layout, but have not touched any thing more than that...

        I've attached my code, any chance you can take a quick look...

        Cheers
        Steve
        Attached Files

        Comment


          #5
          Hi Steve I have just checked through your attached file and I cannot see the printpage function in the page anywhere, is this in one of the JS includes or have you forgotten to add this to the page?

          Nick

          Comment


            #6
            hi nick

            this is within my attached file...

            <BODY onLoad= printPage(); NETQUOTEVAR:BGIMAGE OnLoad="NETQUOTEVAR:ONLOAD" NETQUOTEVAR:BGCOLOR TEXT="NETQUOTEVAR:FGCOLOR" NETQUOTEVAR:LINKCOLOR NETQUOTEVAR:VLINKCOLOR NETQUOTEVAR:ALINKCOLOR marginwidth="5" marginheight="5">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
            <td valign="top">
            .....

            or am is missing something

            Steve

            Comment


              #7
              Yes you are missin the javascript function. Use this link on te first post on this thread and copy the function cose with the <script></script> tags and put them in the <head></ead> tags on your page and then it should work.

              Nick

              Comment


                #8
                Here you go I have modified your file so its ready to use.

                Nick
                Attached Files

                Comment


                  #9
                  sweet, works a treat now.

                  dont suppost it is possible to customise the pop up so instead of saying microsoft internet explorer it says my company name at the top

                  any other neat little things you want to mention...

                  thanks nick

                  Steve

                  Comment


                    #10
                    Hello

                    Following on from yesterday... I notice that it adds to the page at the very top "Free JavaScripts provided by...."

                    I appreciate that it is free, and that I am using it without giving any thing back, but, I am trying to create a professional looking site. I feel that if this is the first thing that is displayed, it will cheapen the overal site.

                    Is it possible to disable this message. I guess if it is not, while it is a sweet function, I'll have to take it out.

                    Hmm

                    Steve

                    Comment


                      #11
                      AAARRRGGGHHHH I am such a cod.

                      Just noticed further down

                      <p><center>
                      <font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
                      by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
                      </center><p>


                      I have now removed this and it is all good.

                      Steve

                      Comment


                        #12
                        Steve did you use the attachment I put up last night?

                        Comment

                        Working...
                        X