Did not work with the patch. Works with the change you suggested
  $('foo').down('[name="'+ prop +'"]');

Can you add this to the patch so it's included in the next release?

Thanks so much for the help.

On Jun 13, 1:47 pm, kangax <[EMAIL PROTECTED]> wrote:
> Does it error with patch applied?
>
> - kangax
>
> On Jun 12, 5:55 pm, louis w <[EMAIL PROTECTED]> wrote:
>
> > Also, i am finding that it errors if your input name is an array. E.g.
> > foo[bar]
>
> > Do you know how to fix this. Should I apply the patch? Would that fix
> > it?
>
> > On Jun 12, 2:53 pm, louis w <[EMAIL PROTECTED]> wrote:
>
> > > kangax, I noticed that if there are two inputs with the same name it
> > > will always return the first occurance of the double item. Even if the
> > > field you are updating is not one of the repeated items.
> > > Don't know if this will impact the patch too.
>
> > > On Jun 10, 11:34 pm, kangax <[EMAIL PROTECTED]> wrote:
>
> > > > This is not included anywhere yet.
> > > > In the upcoming release we try to focus on bugfixes (and general
> > > > polishing), so any enhancements will most likely have to wait for some
> > > > time.
> > > > I made a quick patch for this, but haven't had time to write unit
> > > > tests 
> > > > yet.http://prototype.lighthouseapp.com/attachments/26787/0001-Form.Observ...
>
> > > > - kangax
>
> > > > On Jun 10, 2:55 pm, louis w <[EMAIL PROTECTED]> wrote:
>
> > > > > Thanks kangax, nice to see this was already addressed.
> > > > > Do you know if it is included in any of the stable releases?
>
> > > > > In the meantime I will use your suggestion - which works perfectly.
>
> > > > > On Jun 10, 2:40 pm, kangax <[EMAIL PROTECTED]> wrote:
>
> > > > > > I think this should be "fixed". Knowing which element was changed is
> > > > > > often crucial. I'll make a patch as soon as I get a chance. 
> > > > > > Meanwhile,
> > > > > > you can use this as a workaround:
>
> > > > > > new Form.Observer($(form), 0.3, (function(){
> > > > > >   var previousValue = $(form).serialize(true), element;
> > > > > >   return function(form, value) {
> > > > > >     value = value.parseQuery();
> > > > > >     for (var prop in value) {
> > > > > >       if (value[prop] !== previousValue[prop]) {
> > > > > >         element = $(form).down('[name=' + prop +']');
> > > > > >         break;
> > > > > >       }
> > > > > >     }
> > > > > >     previousValue = value;
> > > > > >     // use "element" variable which references changed element
> > > > > >   }
>
> > > > > > })());
>
> > > > > > Best,
> > > > > > kangax
>
> > > > > > On Jun 10, 1:34 pm, louis w <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Are you saying I need to assign a listener to each input field?
>
> > > > > > > On Jun 10, 12:02 pm, "Frederick Polgardy" <[EMAIL PROTECTED]> 
> > > > > > > wrote:
>
> > > > > > > > Bubbling seems like the answer to me.  Put any listeners you 
> > > > > > > > need (change,
> > > > > > > > select, click, etc.) on the form element, and then in your 
> > > > > > > > callback, use
> > > > > > > > event.element() to get the source element.  From there you can 
> > > > > > > > look at the
> > > > > > > > new value.
>
> > > > > > > > -Fred
>
> > > > > > > > On Tue, Jun 10, 2008 at 10:22 AM, louis w <[EMAIL PROTECTED]> 
> > > > > > > > wrote:
> > > > > > > > > Should I assign a listener to each field? Should I try to get 
> > > > > > > > > it to
> > > > > > > > > work with one listener and use bubbling?
>
> > > > > > > > --
> > > > > > > > Science answers questions; philosophy questions answers.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to