In that case, you're doing it wrong, obviously.

With delegation, you will match elements that are in the attached elements,
when the event is fired.

The elements you're adding the listener, are $$('ul.invite-a-friend'). This
is only one element initially.
So you're only adding the event listener to that element, which delegates
the input-field elements inside.

Probably you should add the listener to the element where you add the new
ULs to, and change the matcher to ul.invite-a-friend .input-field.



On Fri, Jan 27, 2012 at 3:17 PM, hamburger <bilidi...@web.de> wrote:

> Hello again Mr. Andrea,
> yes indeed. But if you add a field not anymore. Thats why the
> delegation is for.
> After posting this, I found that $$('.invite-a-friend-form') was
> wrong.
> shout be:
> $$('ul.invite-a-friend').addEvents({
>    'focus:relay(.input-field)': monitor,
>    'click:relay(.input-field)': monitor
> });
>
> now is working
>
> http://jsfiddle.net/mD3NL/4/
>

Reply via email to