Page 1 of 1

How can I print information in a form

Posted: Sun Jul 01, 2007 11:04 am
by Dilbert137
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Dear All,

I have written a form statement with order data but need these information to be printed. Can someone tell me if it is possible to print form data in the same format.

[syntax="html"]<form name='frm_user'  action="<?php echo $_SERVER['PHP_SELF']; ?>" method='post'>
	<table width='100%' border='1' cellpadding='1' cellspacing='2'>
		<tr>
		    <td align="right" bgcolor="#D8C56F"><b>Order No.:</b></td>
		    <td align="left"><input type="text" name="txt_orderid" size="20" value="<?php echo $result['Num_Cmde']; ?>" READONLY></td>
	            <td>&nbsp;</td>
	  	   <td align="right"><input class="box" name="btnPrint" type="submit" id="btnPrint" value="Print"/></td>
		</tr>



Best Regards
Dilbert137


feyd | Please use[/syntax]

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Sun Jul 01, 2007 11:08 am
by superdezign
You mean to the screen, or a printer?

Posted: Sun Jul 01, 2007 11:11 am
by Dilbert137
To the printer.

Regards
Dilbert137

Posted: Sun Jul 01, 2007 11:30 am
by volka
php is executed server-side and has no control over a client-side printer, if that is your question.
However, the user can of course print the html page and you can add a button like

Code: Select all

<button onlick="window.print()">print document</button>
for their convenience.

Posted: Sun Jul 01, 2007 11:43 am
by Dilbert137
Thanks it's working. I have coded the script like that.

<input class="box" onclick="window.print()" name="btnPrint" type="button" id="btnPrint" value="Print"/>

Best Regards
Dilbert137