Web Analytics Made Easy -
StatCounter cloneNode no result in ie - CodingForum

Announcement

Collapse
No announcement yet.

cloneNode no result in ie

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • cloneNode no result in ie

    Hello all, this works fine in FF, but IE? Not even an error message. If there is more that you need for diagnosis, please let me know. Hope you can shed some light on this. Thanks in advance.

    Code:
    function moveThis(proj,parSel,selNum){
        //alert(proj + "[" + parSel + "][" + selNum + "]");
        //alert(parSel);
        var myNewOpt = document.getElementById(proj + '[' + parSel + '][' + selNum + ']').cloneNode(true);
        alert('test');
        myNewOpt.setAttribute('ondblclick', 'document.getElementById("userProjs[' + parSel + '][]").removeChild(this);');
        document.getElementById('userProjs[' + parSel + '][]').appendChild(myNewOpt);
    }
    
    <select onchange="cdf(4)" id="Properties[4]" name="Properties[4]" size="5" title="Double-click to add projects to user" multiple="multiple">
    <option value="Double-click" selected="selected">Dbl click below</option>
    <option value="property1/" id="property1/[4][0]" name="property1/[4][0]" ondblclick="moveThis('property1/',4,0)">property1/</option>
    <option value="property2/" id="property2/[4][1]" name="property2/[4][1]" ondblclick="moveThis('property2/',4,1)">property2/</option>
    <option value="property3/" id="property3/[4][2]" name="property3/[4][2]" ondblclick="moveThis('property3/',4,2)">property3/</option>
    <option value="property4/" id="property4/[4][3]" name="property4/[4][3]" ondblclick="moveThis('property4/',4,3)">property4/</option>
    <option value="On Broadway/" id="On Broadway/[4][4]" name="On Broadway/[4][4]" ondblclick="moveThis('On Broadway/',4,4)">On Broadway/</option></select>
    
    <select onchange="cdf(4)" id="userProjs[4][]" name="userProjs[4][]" size="5" title="Double-click to remove projects" multiple="multiple">
    <option value="property1/" selected="selected" ondblclick="document.getElementById('userProjs[4][]').removeChild(this);">property1/</option>
    <option value="property2/" selected="selected" ondblclick="document.getElementById('userProjs[4][]').removeChild(this);">property2/</option>
    </select>
      <input id='sendReminder[4]' name='sendReminder[4]' title='Send user password reminder' value='[email protected]&dvbz777' type='checkbox' />
      <input id='d_e_l_e_t_e[4]'  name='d_e_l_e_t_e[4]' title='Delete this user completely' type='checkbox'  />

  • #2
    Code:
    myNewOpt.[COLOR="Red"]setAttribute[/COLOR]('ondblclick', 'document.getElementById("userProjs[' + parSel + '][]").removeChild(this);');
    IE does not consider the events as attributes. One solution could be to use DOM 0 syntax:
    Code:
    myNewOpt.ondblclick=function(){document.getElementById("userProjs[" + parSel + "][]").removeChild(this)}
    BUT! as far as I know IE does not support any event upon the OPTION elements, thus your problem has no solution.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

    Comment

    Working...
    X