Thanks kangax,
I tried renaming the names as you suggested but it's still the same
thing. In Firefox it works, in IE it doesn't. If I change the
following line:
Event.observe('events', 'change', function (e) {
To observe one of the input elements instead
Event.observe('event1', 'change', function (e) {
It works in both IE and Firefox. Upon some further reading I found
from this document:
http://www.w3.org/TR/DOM-Level-2-Events/events.html
That it looks like "change" isn't valid for ol elements. So shame on
Firefox I guess? I'll try observing the form and update the event
details when it's submitted, hopefully that will work.
On Oct 29, 5:16 pm, kangax <[EMAIL PROTECTED]> wrote:
> On Oct 29, 4:01 pm, Dave <[EMAIL PROTECTED]> wrote:
>
>
>
> > As the subject says I have the follow js:
>
> > ----------------
> >Event.observe('events', 'change', function (e) {
> > new Ajax.Updater('event_details',
> > 'URL',
> > { method: 'post',
> > parameters: 'event=' +
> > e.element().id.gsub('event', '') });});
>
> > ----------------
>
> > This is working inFirefoxbut notIE. I'm kind of at a loss as to
> > why it's not working. Taking a guess, maybe it has something to do
> > with whatIEconsiders a "change" to the ol #events:
>
> > ----------------
> > <ol id="events">
> > <li><input id="event1" type="radio" name="event" value="Event1" />
> > <label for="event1">Event1</label></li>
> > <li><input id="event2" type="radio" name="event" value="Event2" />
>
> "event" is a pretty dangerous name to choose [1] : )
>
> Browsers happen to do quite stupid things with named controls - e.g.
> shadowing same-named global variables. In this case,IE'sglobal
> `event` (which actually referenceseventobject wheneventoccurs) is
> most likely shadowed with this input element. This means that `e' is
> resolved to an element (rather than aneventobject) and so everything
> sort of messes up.
>
> Try to "namespace" those names - e.g. use something like "foo-uname",
> "foo-password", etc. and see if the problem still exists.
>
> [snip]
>
> [1]http://jibbering.com/faq/names/
>
> --
> kangax
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---