Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Print page shows unchanged checkbox in IE with DocType


  • Please log in to reply

#1
meikel1999

meikel1999

    New Member

  • Member
  • Pip
  • 2 posts
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.

This is a simple example which fails in IE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="nl" xml:lang="nl-NL"> 
<body>
<input type='checkbox' name='y'/><br/>
<input type='radio' name='x'/><br/>
</body>
</html>

Doesn't work with any doctype I tested (loose or html4).

Anyone a idea how to solve this?

Many thanks,
Michael
  • 0

Advertisements


#2
AstraNut

AstraNut

    Member

  • Member
  • PipPipPip
  • 465 posts
Have you tried using a print only CSS with the link having the media="print" attribute in it? It's better if you set up a print CSS.
  • 0

#3
meikel1999

meikel1999

    New Member

  • Topic Starter
  • Member
  • Pip
  • 2 posts
The complete form (using a large number of text input fields, checkboxes, radiobuttons and select-fields) has a CSS for screen (nice design and colors) and for the printer (plain and with page-headers). This works very good in all tested browsers (IE 6 & 7 & 8, Firefox 3.0 & 3.6, Chrome, Safari on Win & Mac).
But the checkboxes which are checked by the user just aren't printed checked by IE :)

There are a few more hurdles here as the user must be able to fill the form and print it then or print the empty form and fill it with pen. And since it is a public form, it should work in all browsers, even without Javascript enabled. This last one kills the option of using custom checkboxes with onclick and images.
I have fiddled around with replacing the checkboxes with select-fields containing two options: <empty> and √ (&radic;). The principle works and it is printed correctly. But it is not very user-friendly :)
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP