SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member Seinfeld's Avatar
    Join Date
    Jun 2004
    Location
    there's no place like 127.0.01
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Internet Exploder bug: Checkboxes not keeping check state when generated

    Hi folks,
    I have a javascript that generates checkboxes (it's more complex, the lists are re-orderable by drag and drop but this is where the bug is)
    This is a known bug according to QuirksMode but in my case I can't find a good workaround and I tought I'll be lucky here.
    The checkbox is contained in a <li> element, so when I i cloneNode (duplicate the <li>) if the initial checkbox was checked, then unchecked by the user the check state is not remembered by IE 6.0

    Any workaround to this ?

    Another issue (only IE) -> when making DOM operations and there's a lot of css in the page, the screen goes blank for a few miliseconds like it re-renders the page, that's so stupid and eye annoying - I've tried a few workarounds regarding the image cache but no luck... any idea ?

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Portsmouth UK
    Posts
    1,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    strange but true as they say

    crude?

    PHP Code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd"
    >

    <
    html>

    <
    head>
      <
    title></title>
    <
    script language="JavaScript" type="text/javascript">
    <!--
    objAry=new Array();
    function 
    app(){
     
    ck=false;
     if (
    document.getElementById('fred').checked){
     
    ck=true;

     }
     
    objAry[objAry.length]=document.getElementById('fred').cloneNode(true)
     
    document.getElementById('tom').appendChild(objAry[objAry.length-1]);
     
    objAry[objAry.length-1].checked=ck;
    }

    //-->
    </script>
    </head>

    <body >
     <input type="checkbox" id="fred"><br>
     <br>
     <input type="button" name="" value="APPEND" onclick="javascript:app();">
     <div id="tom"></div>

    </body>

    </html> 


Bookmarks

Posting Permissions

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