Okay.
Your script is listening to the <ul> list with ID of "clones" so you will
never get an element id that is not "clones" because it is listening on the
<ul>
event.element() should track it but its not working...
solution 1. use this insetad
$('clones').observe('click',function(event){
var elm=Event.element(event);Rest of your code
Solution 2.
Listen to each <li> inside the <ul> for the click like the following
$$('#clones li').invoke('observe','click',function(event) {
var elm=this; // this will now be the element (this.id will be its ID)
rest of your code.
});
HTH
Alex Mcauley
http://www.thevacancymarket.com
----- Original Message -----
From: "Yan Kovyakh" <[email protected]>
To: <[email protected]>
Sent: Tuesday, July 21, 2009 4:26 PM
Subject: [Proto-Scripty] Delete php
>
> Maybe there's something completely other that causes this problem, if
> someone look at it http://pastie.org/553229
>
>> Already been tried !!!
>>
>> ----- Original Message -----
>> From: "Walter Lee Davis" <[email protected]>
>> To: <[email protected]>
>> Sent: Tuesday, July 21, 2009 4:14 PM
>> Subject: [Proto-Scripty] Re: Delete php
>>
>> > Try this:
>>
>> > $('clones').observe('click',function(evt){
>> > var elm = evt.element();
>> > if(elm.id){
>> > //your code goes here
>> > }
>> > });
>>
>> > Walter
>>
>> > On Jul 21, 2009, at 11:10 AM, Alex McAuley wrote:
>>
>> >> try the follwing then.
>>
>> >> $('clones').observe('click',function(evt,element){
>> >> var elm = element;
>> >> if (elm.hasClassName('remove')){
>> >> evt.stop();
>> >> ----- Original Message -----
>> >> From: Yan Kovyakh
>> >> To: [email protected]
>> >> Sent: Tuesday, July 21, 2009 3:42 PM
>> >> Subject: [Proto-Scripty] Delete php
>>
>> >> The whole element is not working if you place var elm = this;
>>
>> >> $('clones').observe('click',function(evt){
>> >> var elm = this;
>> >> if (elm.hasClassName('remove')){
>> >> evt.stop();
>>
>> >> > you may be able to get the clicked element with "this"
>>
>> >> > Example.
>>
>> >> > $('clones').observe('click',function(evt){
>> >> > var elm = this;
>> >> > ...................... var e=this.id;
>>
>> >> > ----- Original Message -----
>> >> > From: Yan Kovyakh
>> >> > To: [email protected]
>> >> > Sent: Tuesday, July 21, 2009 2:32 PM
>> >> > Subject: [Proto-Scripty] Delete php
>>
>> >> > Look like it can't find the element or the id of the element,
>> >> because
>> >> > all that gets send is "clone" and nothing more.
>> >> > > either its not getting the element or var id=...split()..... is
>> >> > resetiing
>> >> > > something...
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---