Print screen button

Discussion in 'Other Programming' started by midlandi, May 22, 2007.

Remove these ads by signing in
Remove these ads by signing in
Thread Status:
Not open for further replies.
  1. midlandi Can you smell that?

    Member Since:
    Jan 22, 2007
    Message Count:
    4,758
    Likes Received:
    33
    Location:
    Uk
    This button will allow your user to print the screen that they are on.

    HTML:
    <html>

    <head>
    <title>Print screen button</title>
    <script language="JavaScript">
    <!-- hiding
    function varitext(text){
    text=document
    print(text)
    }
    //  End -->
    </script>
    </head>

    <body>
    <div align="center">
    <form>
    <input name="print" type="button" value="Print this Document!"
    onclick="varitext()">
    </form>
    </div>
    </body>
    </html>
     
    1 people like this.
  2. Sa9i New Member

    Member Since:
    May 27, 2007
    Message Count:
    23
    Likes Received:
    0
    thanks for the code
  3. dhscott New Member

    Member Since:
    May 22, 2007
    Message Count:
    96
    Likes Received:
    2
    Print as in Print-out using a Printer or Print Screen as in captures the contents of the screen in an image?

    If its Print-out, surely this would do?

    Code (text):
    function printout() {
    window.print();
    }

    <a href="#" onclick="printout()">#</a>
    Just the way I do it anyway, I'm sure there's more advanced ways of doing it also :)
  4. soori New Member

    Member Since:
    May 28, 2007
    Message Count:
    26
    Likes Received:
    0
    Normally a webmaster should be knowing this piece of code
  5. 1092387456 New Member

    Member Since:
    May 28, 2007
    Message Count:
    50
    Likes Received:
    0
    thanks!, very cool code! im going to install it now.
  6. midlandi Can you smell that?

    Member Since:
    Jan 22, 2007
    Message Count:
    4,758
    Likes Received:
    33
    Location:
    Uk
    I understand what you say, but we dont all know everything. Thats why i want this forum to be different to all the other similar forums.
    I want members to be able to ask the simplest of questions without ridicule, after all we all have "brain freeze" from time to time,and as i say we cat all know everything.
    It would great to see sharing of ideas and help between all of us.Experienced and newbies alike.
    Alot of resource areas seem to be designed soley for the experienced, so lets stand aside from that and create a forum resource site for all.
    We all have different areas of expertise and knowledge,thats a powerfull thing we can create here.
    :):
  7. soori New Member

    Member Since:
    May 28, 2007
    Message Count:
    26
    Likes Received:
    0
    Good piece of reply..
    I agree
Thread Status:
Not open for further replies.

Share This Page