This project is archived and is in readonly mode.

#218 ✓invalid
Thomas Aylott

Element constructor can't construct an element with a selected or checked option

Reported by Thomas Aylott | July 11th, 2008 @ 11:42 AM | in 1.2.1

Comments and changes to this ticket

  • Thomas Aylott

    Thomas Aylott July 11th, 2008 @ 11:42 AM

    Added spec for Element constructor pointing out the fact that you can't construct an element with a selected or checked option.

  • Thomas Aylott

    Thomas Aylott July 17th, 2008 @ 03:44 AM

    • State changed from “new” to “open”

    When you create checkboxes and selects and stuff the selected/checked value isn't being set properly in IE.

    This is a known issue: http://channel9.msdn.com/wiki/in...

    I was wondering if we could come up with a way to work around that issue in MooTools.

    We'd have to add the elements to the document somehow and then set the value. Maybe in the inject/adopt part of the code we check for any attributes that need to be set and then go in and set them at that point.

    I added a spec to the Element.js specs called "should return a form that works in IE6"

    That should probly have a better name ;)

  • xsign

    xsign August 11th, 2008 @ 06:36 AM

    I seriously hope that the bug is fixed somehow. Here is another type of thing, that doesn't work correctly:

    
    <select multiple="multiple" size="5" name="m[frontend][frontend_snippets][0][]" class="input_text">
    

    I try to clone the element by button-click doing this:

    
    var inputCopy = inputField.clone();
    inputCopy.inject(methodsWrapper);
    

    methodsWrapper is a tag. Anyways... after the clone the multiselection is gone. the attribute alone () doesn't work either (even not in FF). Hope it helps fixing this somehow.

  • xsign

    xsign August 11th, 2008 @ 06:38 AM

    ups... tags gone wild up there :)

    methodsWrapper is a tbody tag. Anyways... after the clone the multiselection is gone. the attribute alone (select multiple....) doesn't work either (even not in FF). Hope it helps fixing this somehow.

  • xsign

    xsign August 11th, 2008 @ 06:54 AM

    Well solution is simple, but not quite optimal:

    
    var selects = inputCopy.getElements('select');
    selects.each( function(theSelect, i) {
         theSelect.set('multiple', 'multiple');
    });
    
  • Thomas Aylott

    Thomas Aylott October 5th, 2008 @ 08:50 PM

    • State changed from “open” to “invalid”
    • Tag changed from 1.2release, core, defect, minor to defect

    Apparently this isn't fixable.

    The workaround is that you must manually set the value yourself after inserting it back into the DOM.

    If anyone can come up with some kind of amazing trick that will automagically do this for us, please let us know.

    Until then, this is all we can do :(

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Tags

Referenced by

Pages