[RESOLVED] Print page shows unchanged checkbox in IE with DocType

meikel1999

Hi Guys,

Strange problem. I have a simple webform where users can fill in text and check/uncheck some checkboxes. When this is printed to pdf or paper (or print preview) in IE (7 or 8) the checkboxes are printed unchanged. E.g. user sets a check, this is printed unchecked ... or with a pre-checked box with the user unchecked, is printed checked.

Same goes for the radio.

Only when I remove the DocType completely, IE prints it correctly. But I need to use XHTML-strict.

Fang

Works correctly with any DTD in IE.

Why must you use xhtml when IE does not support it?

meikel1999

Hi Fang ... it shows correctly on screen, but does not print (preview) the checked boxes.

It will be a public form and must be rendered the same in any browser, which it does already. And the form will be used on a website which is in xhtml. There might be a (small) chance that we use a different doctype for this page, but nothing seems to work. I definitely don't want to use IE quirks-mode for obvious reasons.

If anyone has a html-snipplet, or sample site, working in IE please let me know.

Thanks!

Fang

Print pre-view shows correct states in IE with any DTD.

Do you have a css for print?

meikel1999

Hi Fang,
With the above simple test there is no css. Also css would not change if a checkbox would print different. The "real" form is having screen and print css-file but is not the issue here.
Which IE version, language and OS are you testing in?

I've Vista Eng 32 and 64 with IE8 (8.0.6001.18943).
See attached my problem. First I click on the checkbox and radio, than print preview. Shows both unchecked again...

Thanks,
Michael

sample.jpg

23kB

Fang

The same system, except in Dutch. No problem here.
I'm sure there would be mention of this on the web if it were a system problem.
Can we get a link?

tracknut

Michael, just so you don't think you've gone completely mad, I tested your code, and went back to an online form of my own, and I see the same issue you're having.

meikel1999

So ... it seems to be a IE8 bug. D*mn. Just tested it in a Virtual PC with IE6 and that doesn't have a problem.
Fang, thanks for the links. I'll try the suggestion from sitepoint, just hope I can use this header in the actual live site :-s
I'm also curious if the language has anything to do with this. Sadly I don't have any Dutch systems here, but all website visitors using this form will be Dutch so most will have a Dutch system. Gives me some hope!

Thanks!

meikel1999

Just found that IE8 with "Compatibility view" turned ON, it is also printing checkboxes correctly.
Fang, can you please check if you have this turned ON by default?

But when you cannot rely on javascript being turned on, you're screwed by Microsoft.

pauledee

Just joined this forum especially to say thanks to all who contributed to this topic. I had exactly the same problem with IE8!

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

One final point about using the meta tag fix above: it works best if you place it in the head tag BEFORE any links to external CSS files.

The first time I tried using the fix, I placed it at the end of my head tag - after a bunch of stylesheet links and it didn't work. Once I moved the meta tag to the top of my head tag area, it worked fine
Thanks again!