Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Dec 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing option on a web page

    Dear All

    First of all, Hello to all of you, as this is my first time to use this forum .

    I am designing a web site using Frontpage 2003. I need to make a button or an icon and put it in some pages when you click on it will take you to the printer to print that page. I do not know how to create that, and I will appreciate your help and assistance if you could let me know ho to do it.

    Thank you

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Welcome to CodingForums.

    You can cause the print dialog to come up using javascript. Here is a simple example:

    Code:
    <input type="button" onclick="window.print()" value="Print" id="PrintBtn" />
    OracleGuy

  • #3
    New Coder
    Join Date
    Dec 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you so much oracleguy

    That is what exactly I have been looking for !
    I was wondering if I can put any image as a small icon instead of the text (PRINT) or not?

    Thank you

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    <a href="#" onclick="window.print();return false"><img src="yourimage.jpg" alt="" style="border:0"></a>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New Coder
    Join Date
    Dec 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Any Better one ?

    Thank you for both of you guys.

    The java code I put it on some pages in the web site, but when I open that page which has contain this script a message comes on the screen say ....To help protect security internet explorer has restircted this file from showing active contact that could access your computer click here for option..... and then if your right click on it then you can select an option as it gives you three options. I was worried that it might be like that to give the same message on most of the computers, and I thought that I should ask you for a better idea.

    Thank you

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Are you testing locally or on a web server? The message should only occur locally but it should go away once the file is on a web server if the script is harmless.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #7
    New Coder
    Join Date
    Dec 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have been testing it for now, but it will be uploaded on the server later. I was worried that it would be the same when it is uploaded on the server, but as you say that it will go away, then that would be good.

    Thank you

  • #8
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can turn that off by going to Tools > Internet Options > Advanced Tab > Tick Allow active content to run in files on My Computer.

  • #9
    New Coder
    Join Date
    Dec 2005
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you very much Mark87. That was a great solution for that, because it was annoying every time was comeing up, and I had to click on it and allow it myself.
    Thank you


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •