Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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
  • 384 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