PDA

View Full Version : Printing Forms with Checkboxes



pgodwin
Jan 15, 2017, 10:24 PM
I had an issue when printing forms with checkboxes where the checkbox marks would not print. This looks like an issue with the background images.

Original Form:
24816

Form when printed:
24817

My work around was to use the following print-media CSS:


.x-form-checkbox {
display: none;
}
.x-form-cb-checked .x-form-cb-label:before {
content: '☑';
font-size: 18px;
line-height: 0.8;
}


.x-form-cb-label:before {
content: '☐';
font-size: 18px;
line-height: 0.8;
}

With the CSS hack above the form now looked like this when printed:
24818

I'd say radioboxes would be able to modified in the same way.

fabricio.murta
Jan 16, 2017, 5:38 PM
Hello!

Thanks for your suggestion! I noticed this happens with most themes when trying to print using Internet Explorer. On Chrome -- at least by checking both "print preview" and comparing on both browsers -- I see the checkboxes.

To test it I opened this exemple: Checkout Form (http://examples4.ext.net/#/Form/Miscellaneous/Checkout_Form/), then opened it on a new tab, standalone (http://examples4.ext.net/Examples/Form/Miscellaneous/Checkout_Form/). Switched the theme on the full Examples Explorer, then reloaded the standalone example page and then print preview. Triton theme shows the checkboxes on IE's print preview. But all themes shows checkboxes (and radio buttons as well) on Chrome. I'm assuming it will work on Edge, Firefox and Safari as well.

pgodwin
Jan 16, 2017, 11:56 PM
Indeed, it does look like it works if the whole page is printed. If you select a sub-section of the form and choose print selection, the checkboxes disappear (at least with the Gray theme). This also affects other libraries such as printThis (https://github.com/jasonday/printThis) which copy selected elements to an iframe and print from there. I'm guessing the resources don't come through in such circumstances.