...

How do I Disable changes to a <DIV>

Tollman
06-21-2002, 05:11 PM
I'm trying to make a form printable, but no editable, but it has radio buttons and checkboxes that are modifiable. If I disable the entire <DIV> with <DIV disabled=disabled> then it's that crappy gray that isn't very appealing print quality.

So I tried to disable the click even which worked in most cases, but no all

<div id="pnPrintable" onclick="return false;">
.
.
.
</div>

Any clicks within this block are ignored, but with radio buttons it will act like you clicked on of the group, so if a another radio button is checked, and you click a different one. Radio button number 2 isn't changed, but Radio button number one is deselected.

Any suggestions on making a form print nicely, but not editable would be greatly appreciated.

jkd
06-21-2002, 05:23 PM
I think event capturing would work:

document.getElementById('theDIV').addEventListener('click', function (event) { event.stopPropagation(); event.preventDefault(); return false }, true);

But of course, that only works in DOM2-compliant browsers. Anything Gecko-based works, such as NS6, NS7, K-meleon, Galeon, Beonex, or Mozilla...

Tollman
06-21-2002, 05:53 PM
Yeah this is for IE6, so if you or anyone else have anymore ideas I would appreciate it.

Tollman
06-21-2002, 08:45 PM
Well I found out that all I needed was the onclick part, and then since it was the printable page, none of the radio buttons needed to be apart of a group, so I just got rid of all the groups, and it worked, thanks for your help though



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum