On Jan 18, 7:43 pm, jmack159 <[email protected]> wrote:
> hello there,
>
> i have a form for a user to add an article to the CMS system. one
> section of the form, the user has the ability to "attach" publications
> that are already in the system to the article. one div
> ("#attachSelect") contains articles the user can add. when a user
> click on a label, i make a copy of the containing div switch the class
I don't think you are. You are merely assigning the same div to a
different variable, so
element and copy both point to the same object. If you want to make a
copy, you
need to use Object.clone. (But I haven't followed through the logic to
see whether this actually matters to you or not).
> names, then insert the dive into a div containing the added
> publications ("#currAttachments). i then remove the div using
> element.parentNode.remove(). if the user click on one of the added
> publications, the reverse should happen and the div is removed from
> the added div and inserted into the div of publications to be added.
> the checkboxe's value should never be touched so that when inside
> div#attachSelect the checkbox is not selected, and with within
> div#currAttachments the checkbox is selected. everything works fine in
> FF 2/3, netscape, google chrome, but breaks in IE 7. in IE 7 the
> publications are added ok, but are unable to be removed. (checkbox can
> be toggled, but its parent div is not removed). i get no errors with
> firebug in FF or through IE
>
> i originally tried to do this with the checkbox event "onchange", and
> i got the same result, except for the added IE bug of the delayed
> onchange (delayed until the element looses focus).
>
It's not a bug, it's correct behaviour according to the standard: [1]
"onchange = script [CT]
The onchange event occurs when a control loses the input focus and
its value has been modified since gaining focus. This attribute
applies to the following elements: INPUT, SELECT, and TEXTAREA."
Use 'onclick' instead.
One other point - I'm not at all sure that writeAttribute
('onclick', ...) works, and on which browsers. MUCH better to use
$(copy2).observe('click', addPub);
(Note that you have to pass a function, not a string or a function
call).
I don't know if any of these points will help your problem or not.
Colin Fine
[1] http://www.w3.org/TR/html401/interact/scripts.html#events
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---