Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I Disable changes to a <DIV>

    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.

  • #2
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    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...

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah this is for IE6, so if you or anyone else have anymore ideas I would appreciate it.

  • #4
    New Coder
    Join Date
    Jun 2002
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •