[html-formfu] How to Display a printable copy of the form

Charlie Garrison garrison at zeta.org.au
Sat Oct 10 01:22:51 GMT 2009


Good afternoon,

On 9/10/09 at 12:43 PM -0400, Ascii King 
<tech at swattermatter.com> wrote:

>I am not looking for code formatting. I would like to create a 
>presentable report that shows what the user enetered into the 
>form fields. The report would be printable and not be full of 
>the input boxes. The way i would do this normally is load the 
>data into an object and then build a display sheet that places 
>the data exactly where I want it, so that when the user prints 
>it out, it looks nice. I figure I will have to do that here, 
>too. I was just wondering if i was missing out on a neat mod 
>that helped format this for me using the form config files.

You should be able to do that with a media=print style sheet:

<link rel="stylesheet"
    type="text/css"
    media="print" href="print.css" />

Example from <http://www.alistapart.com/articles/goingtoprint/>.

You can change the border, background, display style, etc. for 
input elements on the form. Radio buttons may pose more of a 
challenge. It means you don't need a different form config for 
printing, you just need a different style sheet (which can be 
used for all forms, dry).

Using extra classes, it also is easy to hide things like submit 
buttons; eg. create a .noprint class {display:none} and assign 
it to all non-printing elements.

Charlie

-- 
    Charlie Garrison  <garrison at zeta.org.au>
    PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
http://www.ietf.org/rfc/rfc1855.txt



More information about the HTML-FormFu mailing list