Forum Moderators: coopster

Message Too Old, No Replies

print a page

how to print out a page

         

watermelon

11:05 am on Jun 17, 2003 (gmt 0)

10+ Year Member



hi, i have a result page. then inside it, there is a button called 'printable'. when i click on it, it will print out the current page through printer. now, my problem is, how should i write the coding for this button 'printable'? could you show me the coding? thank you.

waldemar

11:16 am on Jun 17, 2003 (gmt 0)

10+ Year Member



<form><input type="button" id="print" name="print" value="Print" onClick="javascript:window.print()"></form>

should do it...
regards

watermelon

11:22 am on Jun 17, 2003 (gmt 0)

10+ Year Member



thank you very much.

waldemar

1:53 pm on Jun 17, 2003 (gmt 0)

10+ Year Member



You're welcome! But remember not everybody has turned on JavaScript ;-)...

watermelon

3:56 pm on Jun 17, 2003 (gmt 0)

10+ Year Member



is there any other script which is written in PHP to do this function? thanks.

waldemar

5:07 pm on Jun 17, 2003 (gmt 0)

10+ Year Member



Not that I'm aware of. Printing is a client-specific thing in which the server isn't involved at all.
I'm just asking carefully, why you want to include a seperate Print-Button when the user can access the 'Print...' function in the 'file' menu anytime he/she likes...;-)