[Proto-Scripty] Delete php

2009-07-22 Thread Yan Kovyakh
Just like MaGic! No, no magic, it's all you! Thanks everybody who
contributed in helping me, that means a lot, you're awesome!

Thanks!

 

 

 In your layout, you are not using the A tag, but rather the LI tag to  

 carry the ID. Since that's the case (which is why you are using  

 this, I think) maybe the thing to do is to change  

 elm.up('li').remove(); to elm.remove() and see if that does the trick  

 for you.

 

 Walter

 

 On Jul 21, 2009, at 6:12 PM, Yan Kovyakh wrote:

 

  WOW Great! Though it's still aren't removing the link dynamically:  

  elm.up('li').remove(); neither by: $(this).remove();

  Thanks for the amazing support so far!

 

   its $_POST['clone']

 

   not $_POST['the_id']

 

   thats why !!


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
I don't really want to change the whole script, and the problem is that I
can't get the ID out, not the script.

Is there any way to extract an ID instead of doing:

var id = elm.id.split('_').last();

Because everything up to that point is working, I'm confused.

 

 

 Ya, I'm getting an empty box, so something is wrong.

 

  Dude, firstly please stop topping the message and removing the code and

 replies from your replies.

 

  secondly: try the below script and see what gets alerted (it should be

 your numeric ID, if not then you have something wrong somewhere

 

  $('clones').observe('click',function(evt){

 

var elm = evt.element();

 

if (elm.hasClassName('remove')){

 

  evt.stop();

 

  var id = elm.id.split('_').last();

 

  alert(id);

 

  return;

 

  new Ajax.Request('remove_clone.php',{

 

parameters:{clone:id},

 

onSuccess:function(transport){

 

  elm.up('li').remove();

 

  pollSortable.defer();

 

}

 

  });

 

- Original Message -

From: Yan Kovyakh

To: prototype-scriptaculous@googlegroups.com

Sent: Monday, July 20, 2009 7:35 PM

Subject: [Proto-Scripty] Delete php

 

They actualy have Item_numericalID

 

Is this the problem?


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete PHP

2009-07-21 Thread Yan Kovyakh
Well yes, this does gives me a true, and in post of the remove_clone.php  I
see clone 1234. But that's because you specified  

var e='blah_1234';

But how am I going to connect my clone:id parameter?

 

 Here is one way to do it (though probably not the best) - but it works

  var e='blah_1234';

 

  var i=e.split('_');

  var l=i.length-1;

 var id=(l=1) ? i[l] : 'NULL' ;

 var test=(id.length=1) ? true : false ;

 alert(test); // true means its set and has a string length greater than 1,
false means there is nothing after _

 

 then you can test it with

 

 if(test!==true) {

 

 alert('No ID Found');

 return

 

 }

 

 parameters : { clone: id }

 

 HTH

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 10:00 AM

   Subject: [Proto-Scripty] Delete php

 

   I don't really want to change the whole script, and the problem is that
I can't get the ID out, not the script.

 

   Is there any way to extract an ID instead of doing:

 

   var id = elm.id.split('_').last();

 

   Because everything up to that point is working, I'm confused.

 

Ya, I'm getting an empty box, so something is wrong.

 

 Dude, firstly please stop topping the message and removing the code
and

 

replies from your replies.

 

 secondly: try the below script and see what gets alerted (it should
be

 

your numeric ID, if not then you have something wrong somewhere

 

 $('clones').observe('click',function(evt){

 

   var elm = evt.element();

 

   if (elm.hasClassName('remove')){

 

 evt.stop();

 

 var id = elm.id.split('_').last();

 

 alert(id);

 

 return;

 

 new Ajax.Request('remove_clone.php',{

 

   parameters:{clone:id},

 

   onSuccess:function(transport){

 

 elm.up('li').remove();

 

 pollSortable.defer();

 

   }

 

 });

 

   - Original Message -

 

   From: Yan Kovyakh

 

   To: prototype-scriptaculous@googlegroups.com

 

   Sent: Monday, July 20, 2009 7:35 PM

 

   Subject: [Proto-Scripty] Delete php

 

   They actualy have Item_numericalID

 

   Is this the problem?


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
Well yes, this does gives me a true, and in post of the remove_clone.php  I
see clone 1234. But that's because you specified  

var e='blah_1234';

But how am I going to connect my clone:id parameter?

 

 Here is one way to do it (though probably not the best) - but it works

  var e='blah_1234';

 

  var i=e.split('_');

  var l=i.length-1;

 var id=(l=1) ? i[l] : 'NULL' ;

 var test=(id.length=1) ? true : false ;

 alert(test); // true means its set and has a string length greater than 1,

 false means there is nothing after _

 

 then you can test it with

 

 if(test!==true) {

 

 alert('No ID Found');

 return

 

 }

 

 parameters : { clone: id }

 

 HTH

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 10:00 AM

   Subject: [Proto-Scripty] Delete php

 

   I don't really want to change the whole script, and the problem is that 

I can't get the ID out, not the script.

 

   Is there any way to extract an ID instead of doing:

 

   var id = elm.id.split('_').last();

 

   Because everything up to that point is working, I'm confused.

 

Ya, I'm getting an empty box, so something is wrong.

 

 Dude, firstly please stop topping the message and removing the code 

 and

 

replies from your replies.

 

 secondly: try the below script and see what gets alerted (it should 

be

 

your numeric ID, if not then you have something wrong somewhere

 

 $('clones').observe('click',function(evt){

 

   var elm = evt.element();

 

   if (elm.hasClassName('remove')){

 

 evt.stop();

 

 var id = elm.id.split('_').last();

 

 alert(id);

 

 return;

 

 new Ajax.Request('remove_clone.php',{

 

   parameters:{clone:id},

 

   onSuccess:function(transport){

 

 elm.up('li').remove();

 

 pollSortable.defer();

 

   }

 

 });

 

   - Original Message -

 

   From: Yan Kovyakh

 

   To: prototype-scriptaculous@googlegroups.com

 

   Sent: Monday, July 20, 2009 7:35 PM

 

   Subject: [Proto-Scripty] Delete php

 

   They actualy have Item_numericalID

 

   Is this the problem?


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
Don't really understand what should I do with that line?

 

 var elm=evt.element().id; //is the id of the element no ?

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 11:27 AM

   Subject: [Proto-Scripty] Delete php

 

   Well yes, this does gives me a true, and in post of the remove_clone.php
I see clone 1234. 

  But that's because you specified  

   var e='blah_1234';

 

   But how am I going to connect my clone:id parameter?

 

Here is one way to do it (though probably not the best) - but it works

 

 var e='blah_1234';

 

 var i=e.split('_');

 

 var l=i.length-1;

 

var id=(l=1) ? i[l] : 'NULL' ;

 

var test=(id.length=1) ? true : false ;

 

alert(test); // true means its set and has a string length greater
than 1,

 

false means there is nothing after _

 

then you can test it with

 

if(test!==true) {

 

alert('No ID Found');

 

return

 

}

 

parameters : { clone: id }

 

HTH

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 10:00 AM

 

  Subject: [Proto-Scripty] Delete php

 

  I don't really want to change the whole script, and the problem is
that

 

   I can't get the ID out, not the script.

 

  Is there any way to extract an ID instead of doing:

 

  var id = elm.id.split('_').last();

 

  Because everything up to that point is working, I'm confused.

 

   Ya, I'm getting an empty box, so something is wrong.

 

Dude, firstly please stop topping the message and removing the
code

 

and

 

   replies from your replies.

 

secondly: try the below script and see what gets alerted (it
should

 

   be

 

   your numeric ID, if not then you have something wrong somewhere

 

$('clones').observe('click',function(evt){

 

  var elm = evt.element();

 

  if (elm.hasClassName('remove')){

 

evt.stop();

 

var id = elm.id.split('_').last();

 

alert(id);

 

return;

 

new Ajax.Request('remove_clone.php',{

 

  parameters:{clone:id},

 

  onSuccess:function(transport){

 

elm.up('li').remove();

 

pollSortable.defer();

 

  }

 

});

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Monday, July 20, 2009 7:35 PM

 

  Subject: [Proto-Scripty] Delete php

 

  They actualy have Item_numericalID

 

  Is this the problem?


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
Don't really understand what should I do with that line?

 

 var elm=evt.element().id; //is the id of the element no ?

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 11:27 AM

   Subject: [Proto-Scripty] Delete php

 

   Well yes, this does gives me a true, and in post of the remove_clone.php


 I see clone 1234. 

  But that's because you specified  

   var e='blah_1234';

 

   But how am I going to connect my clone:id parameter?

 

Here is one way to do it (though probably not the best) - but it works

 

 var e='blah_1234';

 

 var i=e.split('_');

 

 var l=i.length-1;

 

var id=(l=1) ? i[l] : 'NULL' ;

 

var test=(id.length=1) ? true : false ;

 

alert(test); // true means its set and has a string length greater 

  than 1,

false means there is nothing after _

 

then you can test it with

 

if(test!==true) {

 

alert('No ID Found');

 

return

 

}

 

parameters : { clone: id }

 

HTH

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 10:00 AM

 

  Subject: [Proto-Scripty] Delete php

 

  I don't really want to change the whole script, and the problem is

  that

   I can't get the ID out, not the script.

 

  Is there any way to extract an ID instead of doing:

 

  var id = elm.id.split('_').last();

 

  Because everything up to that point is working, I'm confused.

 

   Ya, I'm getting an empty box, so something is wrong.

 

Dude, firstly please stop topping the message and removing the

  code

and

 

   replies from your replies.

 

secondly: try the below script and see what gets alerted (it 

  should

   be

 

   your numeric ID, if not then you have something wrong somewhere

 

$('clones').observe('click',function(evt){

 

  var elm = evt.element();

 

  if (elm.hasClassName('remove')){

 

evt.stop();

 

var id = elm.id.split('_').last();

 

alert(id);

 

return;

 

new Ajax.Request('remove_clone.php',{

 

  parameters:{clone:id},

 

  onSuccess:function(transport){

 

elm.up('li').remove();

 

pollSortable.defer();

 

  }

 

});

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Monday, July 20, 2009 7:35 PM

 

  Subject: [Proto-Scripty] Delete php

 

  They actualy have Item_numericalID

 

  Is this the problem?


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
I'm getting true in a test but NULL as an post ID. Every element has an Id: 

li id=Item_55span class=remove(x)/span/li

I'm getting frustrated as much as you do Alex, the last pledge for help
would be to send in the whole script.

http://pastie.org/553229

 

 

 I suggest you give up lol because it really doesnt get any simpler than 

  what i offered.

 If however you do not wish to give up i will give you the answer.

 

 var e=evt.element().id;

 

 

 Then use the script given to you by me to get the actual ID from e

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 11:47 AM

   Subject: [Proto-Scripty] Delete php

 

   Don't really understand what should I do with that line?

 

var elm=evt.element().id; //is the id of the element no ?

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 11:27 AM

 

  Subject: [Proto-Scripty] Delete php

 

  Well yes, this does gives me a true, and in post of the 

  remove_clone.php

I see clone 1234.

 

 But that's because you specified  

 

  var e='blah_1234';

 

  But how am I going to connect my clone:id parameter?

 

   Here is one way to do it (though probably not the best) 

 - but it works

var e='blah_1234';

 

var i=e.split('_');

 

var l=i.length-1;

 

   var id=(l=1) ? i[l] : 'NULL' ;

 

   var test=(id.length=1) ? true : false ;

 

   alert(test); // true means its set and has a string 

  length greater

 than 1,

 

   false means there is nothing after _

 

   then you can test it with

 

   if(test!==true) {

 

   alert('No ID Found');

 

   return

 

   }

 

   parameters : { clone: id }

 

   HTH

 

 - Original Message -

 

 From: Yan Kovyakh

 

 To: prototype-scriptaculous@googlegroups.com

 

 Sent: Tuesday, July 21, 2009 10:00 AM

 

 Subject: [Proto-Scripty] Delete php

 

 I don't really want to change the whole scripts

 , and the problem i

 that

 

  I can't get the ID out, not the script.

 

 Is there any way to extract an ID instead of doing:

 

 var id = elm.id.split('_').last();

 

 Because everything up to that point is working

 , I'm confused.

  Ya, I'm getting an empty box, so something 

  is wrong.

   Dude, firstly please stop topping the message 

  and removing the

 code

 

   and

 

  replies from your replies.

 

   secondly: try the below script and see 

  what gets alerted (it

 should

 

  be

 

  your numeric ID, if not then you have 

  something wrong somewhere

   $('clones').observe('click',function(evt){

 

 var elm = evt.element();

 

 if (elm.hasClassName('remove')){

 

   evt.stop();

 

   var id = elm.id.split('_').last();

 

   alert(id);

 

   return;

 

   new Ajax.Request('remove_clone.php',{

 

 parameters:{clone:id},

 

 onSuccess:function(transport){

 

   elm.up('li').remove();

 

   pollSortable.defer();

 

 }

 

   });

 

 - Original Message -

 

 From: Yan Kovyakh

 

 To: prototype-scriptaculous@googlegroups.com

 

 Sent: Monday, July 20, 2009 7:35 PM

 

 Subject: [Proto-Scripty] Delete php

 

 They actualy have Item_numericalID

 

 Is this the problem?


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---

attachment: winmail.dat

[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
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...

 

 Try

 

 var theid = elm.id.split('_').last();parameters :{clone:id}...Or if you
cant

 do it in javascript send the whole id of the element and split it in

 php?php // remove_clone.php$id=end(explode(_,$_POST['clone'])); ?

 

 - Original Message -

 From: Yan Kovyakh maybe...@gmail.com

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 12:38 PM

 Subject: [Proto-Scripty] Delete php

 

  I'm getting true in a test but NULL as an post ID. Every element has an

  Id:

 

  li id=Item_55span class=remove(x)/span/li

 

  I'm getting frustrated as much as you do Alex, the last pledge for help

  would be to send in the whole script.

 

 http://pastie.org/553229

 

  I suggest you give up lol because it really doesnt get any simpler than

 

   what i offered.

 

  If however you do not wish to give up i will give you the answer.

 

  var e=evt.element().id;

 

  

 

  Then use the script given to you by me to get the actual ID from e

 

- Original Message -

 

From: Yan Kovyakh

 

To: prototype-scriptaculous@googlegroups.com

 

Sent: Tuesday, July 21, 2009 11:47 AM

 

Subject: [Proto-Scripty] Delete php

 

Don't really understand what should I do with that line?

 

 var elm=evt.element().id; //is the id of the element no ?

 

   - Original Message -

 

   From: Yan Kovyakh

 

   To: prototype-scriptaculous@googlegroups.com

 

   Sent: Tuesday, July 21, 2009 11:27 AM

 

   Subject: [Proto-Scripty] Delete php

 

   Well yes, this does gives me a true, and in post of the

 

   remove_clone.php

 

 I see clone 1234.

 

  But that's because you specified

 

   var e='blah_1234';

 

   But how am I going to connect my clone:id parameter?

 

Here is one way to do it (though probably not the best)

 

  - but it works

 

 var e='blah_1234';

 

 var i=e.split('_');

 

 var l=i.length-1;

 

var id=(l=1) ? i[l] : 'NULL' ;

 

var test=(id.length=1) ? true : false ;

 

alert(test); // true means its set and has a string

 

   length greater

 

  than 1,

 

false means there is nothing after _

 

then you can test it with

 

if(test!==true) {

 

alert('No ID Found');

 

return

 

}

 

parameters : { clone: id }

 

HTH

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 10:00 AM

 

  Subject: [Proto-Scripty] Delete php

 

  I don't really want to change the whole scripts

 

  , and the problem i

 

  that

 

   I can't get the ID out, not the script.

 

  Is there any way to extract an ID instead of doing:

 

  var id = elm.id.split('_').last();

 

  Because everything up to that point is working

 

  , I'm confused.

 

   Ya, I'm getting an empty box, so something

 

   is wrong.

 

Dude, firstly please stop topping the message

 

   and removing the

 

  code

 

and

 

   replies from your replies.

 

secondly: try the below script and see

 

   what gets alerted (it

 

  should

 

   be

 

   your numeric ID, if not then you have

 

   something wrong somewhere

 

$('clones').observe('click',function(evt){

 

  var elm = evt.element();

 

  if (elm.hasClassName('remove')){

 

evt.stop();

 

var id = elm.id.split('_').last();

 

alert(id);

 

return;

 

new Ajax.Request('remove_clone.php',{

 

  parameters:{clone:id},

 

  onSuccess:function(transport){

 

elm.up('li').remove();

 

pollSortable.defer();

 

  }

 

});

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Monday, July 20, 2009 7:35 PM

 

  Subject: [Proto-Scripty] Delete php

 

  They actualy have Item_numericalID

 

  Is this the problem?


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr

[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
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: prototype-scriptaculous@googlegroups.com

   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...

 

Try

 

var theid = elm.id.split('_').last();parameters :{clone:id}...Or if
you

 

   cant

 

do it in javascript send the whole id of the element and split it in

 

php?php // remove_clone.php$id=end(explode(_,$_POST['clone'])); ?

 

- Original Message -

 

From: Yan Kovyakh maybe...@gmail.com

 

To: prototype-scriptaculous@googlegroups.com

 

Sent: Tuesday, July 21, 2009 12:38 PM

 

Subject: [Proto-Scripty] Delete php

 

 I'm getting true in a test but NULL as an post ID. Every element has
an

 

 Id:

 

 li id=Item_55span class=remove(x)/span/li

 

 I'm getting frustrated as much as you do Alex, the last pledge for
help

 

 would be to send in the whole script.

 

http://pastie.org/553229

 

 I suggest you give up lol because it really doesnt get any simpler
than

 

  what i offered.

 

 If however you do not wish to give up i will give you the answer.

 

 var e=evt.element().id;

 

 

 

 Then use the script given to you by me to get the actual ID from
e

 

   - Original Message -

 

   From: Yan Kovyakh

 

   To: prototype-scriptaculous@googlegroups.com

 

   Sent: Tuesday, July 21, 2009 11:47 AM

 

   Subject: [Proto-Scripty] Delete php

 

   Don't really understand what should I do with that line?

 

var elm=evt.element().id; //is the id of the element no ?

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 11:27 AM

 

  Subject: [Proto-Scripty] Delete php

 

  Well yes, this does gives me a true, and in post of the

 

  remove_clone.php

 

I see clone 1234.

 

 But that's because you specified

 

  var e='blah_1234';

 

  But how am I going to connect my clone:id parameter?

 

   Here is one way to do it (though probably not the best)

 

 - but it works

 

var e='blah_1234';

 

var i=e.split('_');

 

var l=i.length-1;

 

   var id=(l=1) ? i[l] : 'NULL' ;

 

   var test=(id.length=1) ? true : false ;

 

   alert(test); // true means its set and has a string

 

  length greater

 

 than 1,

 

   false means there is nothing after _

 

   then you can test it with

 

   if(test!==true) {

 

   alert('No ID Found');

 

   return

 

   }

 

   parameters : { clone: id }

 

   HTH

 

 - Original Message -

 

 From: Yan Kovyakh

 

 To: prototype-scriptaculous@googlegroups.com

 

 Sent: Tuesday, July 21, 2009 10:00 AM

 

 Subject: [Proto-Scripty] Delete php

 

 I don't really want to change the whole scripts

 

 , and the problem i

 

 that

 

  I can't get the ID out, not the script.

 

 Is there any way to extract an ID instead of doing:

 

 var id = elm.id.split('_').last();

 

 Because everything up to that point is working

 

 , I'm confused.

 

  Ya, I'm getting an empty box, so something

 

  is wrong.

 

   Dude, firstly please stop topping the message

 

  and removing the

 

 code

 

   and

 

  replies from your replies.

 

   secondly: try the below script and see

 

  what gets alerted (it

 

 should

 

  be

 

  your numeric ID, if not then you have

 

  something wrong somewhere

 

   $('clones').observe('click',function(evt){

 

 var elm = evt.element();

 

 if (elm.hasClassName('remove')){

 

   evt.stop();

 

   var id = elm.id.split('_').last();

 

   alert(id);

 

   return;

 

   new Ajax.Request('remove_clone.php',{

 

 parameters:{clone:id

[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
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: prototype-scriptaculous@googlegroups.com

   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...

 

Try

 

var theid = elm.id.split('_').last();parameters :{clone:id}...Or 

  if you

   cant

 

do it in javascript send the whole id of the element and split it in

 

php?php // remove_clone.php$id=end(explode(_,$_POST['clone'])); ?

 

- Original Message -

 

From: Yan Kovyakh maybe...@gmail.com

 

To: prototype-scriptaculous@googlegroups.com

 

Sent: Tuesday, July 21, 2009 12:38 PM

 

Subject: [Proto-Scripty] Delete php

 

 I'm getting true in a test but NULL as an post ID. Every element 

  has an

 Id:

 

 li id=Item_55span class=remove(x)/span/li

 

 I'm getting frustrated as much as you do Alex, the last pledge 

  for help

 would be to send in the whole script.

 

http://pastie.org/553229

 

 I suggest you give up lol because it really doesnt get any 

  simpler than

  what i offered.

 

 If however you do not wish to give up i will give you the answer.

 

 var e=evt.element().id;

 

 

 

 Then use the script given to you by me to get the actual ID 

  from e

   - Original Message -

 

   From: Yan Kovyakh

 

   To: prototype-scriptaculous@googlegroups.com

 

   Sent: Tuesday, July 21, 2009 11:47 AM

 

   Subject: [Proto-Scripty] Delete php

 

   Don't really understand what should I do with that line?

 

var elm=evt.element().id; //is the id of the element no ?

 

  - Original Message -

 

  From: Yan Kovyakh

 

  To: prototype-scriptaculous@googlegroups.com

 

  Sent: Tuesday, July 21, 2009 11:27 AM

 

  Subject: [Proto-Scripty] Delete php

 

  Well yes, this does gives me a true, and in post of the

 

  remove_clone.php

 

I see clone 1234.

 

 But that's because you specified

 

  var e='blah_1234';

 

  But how am I going to connect my clone:id parameter?

 

   Here is one way to do it (though probably not the best)

 

 - but it works

 

var e='blah_1234';

 

var i=e.split('_');

 

var l=i.length-1;

 

   var id=(l=1) ? i[l] : 'NULL' ;

 

   var test=(id.length=1) ? true : false ;

 

   alert(test); // true means its set and has a string

 

  length greater

 

 than 1,

 

   false means there is nothing after _

 

   then you can test it with

 

   if(test!==true) {

 

   alert('No ID Found');

 

   return

 

   }

 

   parameters : { clone: id }

 

   HTH

 

 - Original Message -

 

 From: Yan Kovyakh

 

 To: prototype-scriptaculous@googlegroups.com

 

 Sent: Tuesday, July 21, 2009 10:00 AM

 

 Subject: [Proto-Scripty] Delete php

 

 I don't really want to change the whole scripts

 

 , and the problem i

 

 that

 

  I can't get the ID out, not the script.

 

 Is there any way to extract an ID instead of doing:

 

 var id = elm.id.split('_').last();

 

 Because everything up to that point is working

 

 , I'm confused.

 

  Ya, I'm getting an empty box, so something

 

  is wrong.

 

   Dude, firstly please stop topping the message

 

  and removing the

 

 code

 

   and

 

  replies from your replies.

 

   secondly: try the below script and see

 

  what gets alerted (it

 

 should

 

  be

 

  your numeric ID, if not then you have

 

  something wrong somewhere

 

   $('clones').observe('click',function(evt){

 

 var elm = evt.element();

 

 if (elm.hasClassName('remove')){

 

   evt.stop();

 

   var id = elm.id.split('_').last();

 

   alert(id);

 

   return;

 

   new Ajax.Request('remove_clone.php',{

 

 parameters

[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh

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 wa...@wdstudio.com
 To: prototype-scriptaculous@googlegroups.com
 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: prototype-scriptaculous@googlegroups.com
  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: prototype-scriptaculous@googlegroups.com
 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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh

Both of the solutions causes script not to work at all, just to make sure
I'm connecting all right.
http://jsbin.com/igixe/edit

 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 Mcauleyhttp://www.thevacancymarket.com
 
 - Original Message -
 From: Yan Kovyakh maybe...@gmail.com
 To: prototype-scriptaculous@googlegroups.com
 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 wa...@wdstudio.com
  To: prototype-scriptaculous@googlegroups.com
  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.



--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh

Says nothing, it's unclick-able now.



and firebug says ?

you have an undefined error in there for a start with evt.stop();



Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Yan Kovyakh maybe...@gmail.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 5:04 PM
Subject: [Proto-Scripty] Delete php



 Both of the solutions causes script not to work at all, just to make sure
 I'm connecting all right.
 http://jsbin.com/igixe/edit

 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 Mcauleyhttp://www.thevacancymarket.com

 - Original Message -
 From: Yan Kovyakh maybe...@gmail.com
 To: prototype-scriptaculous@googlegroups.com
 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 wa...@wdstudio.com
  To: prototype-scriptaculous@googlegroups.com
  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 


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
Great, now it finds the correct ID, and sends a post of clone ID but the
rest of the code seems not working:

 

new Ajax.Request('remove_clone.php',{

  parameters:{clone:the_id},

  onSuccess:function(transport){

elm.up('li').remove();

pollSortable.defer();

 }

 });

   });  

});

 

The last 2 lines of the code doesn't work, it's not removing the li anymore.


 

 

 $$('#clones li').invoke('observe','click',function(event) {

   var elm=this;

   if (elm.hasClassName('remove')){ // this was unclosed

 

 Event.stop(event);

 } // now closed properly

   var the_id = elm.id.split('_').last();

alert(the_id);  // remove this to make it work

  return; // remove this to make it work

 new Ajax.Request('remove_clone.php',{

   parameters:{clone:the_id},

   onSuccess:function(transport){

 elm.up('li').remove();

 pollSortable.defer();

   }

 });

  });

 

 That works because i just tested it, it alerts 1234 for the follwing html

 and 4567 for the second list element.

 

 See the comments in the code to make it work for you.

 

 ul id=clones

 li id=foo_1234ID = foo_1234/li

  li id=foo_4567ID = foo_4567 /li

   /ul

 

 Alex Mcauleyhttp://www.thevacancymarket.com

 

 - Original Message -

 From: Yan Kovyakh maybe...@gmail.com

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 5:17 PM

 Subject: [Proto-Scripty] Delete php

 

  Says nothing, it's unclick-able now.

 

 and firebug says ?

 

 you have an undefined error in there for a start with evt.stop();

 

 Alex Mcauley

 http://www.thevacancymarket.com

 - Original Message -

 From: Yan Kovyakh maybe...@gmail.com

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 5:04 PM

 Subject: [Proto-Scripty] Delete php

 

  Both of the solutions causes script not to work at all, just to make
sure

  I'm connecting all right.

 http://jsbin.com/igixe/edit

 

  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 Mcauleyhttp://www.thevacancymarket.com

 

  - Original Message -

  From: Yan Kovyakh maybe...@gmail.com

  To: prototype-scriptaculous@googlegroups.com

  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 wa...@wdstudio.com

   To: prototype-scriptaculous@googlegroups.com

   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


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
Great, now it finds the correct ID, and sends a post of clone ID but the
rest of the code seems not working:

 

new Ajax.Request('remove_clone.php',{

  parameters:{clone:the_id},

  onSuccess:function(transport){

elm.up('li').remove();

pollSortable.defer();

 }

 });

   });  

});

 

The last 2 lines of the code doesn't work, it's not removing the li anymore.


 

 

 $$('#clones li').invoke('observe','click',function(event) {

   var elm=this;

   if (elm.hasClassName('remove')){ // this was unclosed

 

 Event.stop(event);

 } // now closed properly

   var the_id = elm.id.split('_').last();

alert(the_id);  // remove this to make it work

  return; // remove this to make it work

 new Ajax.Request('remove_clone.php',{

   parameters:{clone:the_id},

   onSuccess:function(transport){

 elm.up('li').remove();

 pollSortable.defer();

   }

 });

  });

 

 That works because i just tested it, it alerts 1234 for the follwing html

 and 4567 for the second list element.

 

 See the comments in the code to make it work for you.

 

 ul id=clones

 li id=foo_1234ID = foo_1234/li

  li id=foo_4567ID = foo_4567 /li

   /ul

 

 Alex Mcauleyhttp://www.thevacancymarket.com

 

 - Original Message -

 From: Yan Kovyakh maybe...@gmail.com

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 5:17 PM

 Subject: [Proto-Scripty] Delete php

 

  Says nothing, it's unclick-able now.

 

 and firebug says ?

 

 you have an undefined error in there for a start with evt.stop();

 

 Alex Mcauley

 http://www.thevacancymarket.com

 - Original Message -

 From: Yan Kovyakh maybe...@gmail.com

 To: prototype-scriptaculous@googlegroups.com

 Sent: Tuesday, July 21, 2009 5:04 PM

 Subject: [Proto-Scripty] Delete php

 

  Both of the solutions causes script not to work at all, just to make 

  sure  I'm connecting all right.

 http://jsbin.com/igixe/edit

 

  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 Mcauleyhttp://www.thevacancymarket.com

 

  - Original Message -

  From: Yan Kovyakh maybe...@gmail.com

  To: prototype-scriptaculous@googlegroups.com

  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 wa...@wdstudio.com

   To: prototype-scriptaculous@googlegroups.com

   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


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
Alert works up to the last 2 lines, up to the elm.up('li').remove();

 

 Put an alert in there, or a console.log, and see if your Ajax.Request  

 is even returning success. If it doesn't, you will never see anything  

 happen to that list item.

 

 Walter

 

 On Jul 21, 2009, at 1:47 PM, Yan Kovyakh wrote:

 

  Great, now it finds the correct ID, and sends a post of clone ID  

  but the rest of the code seems not working:

 

  new Ajax.Request('remove_clone.php',{

parameters:{clone:the_id},

onSuccess:function(transport){

  elm.up('li').remove();

  pollSortable.defer();

   }

   });

 });

  });

 

  The last 2 lines of the code doesn't work, it's not removing the li  

  anymore.

 

   $$('#clones li').invoke('observe','click',function(event) {

 var elm=this;

 if (elm.hasClassName('remove')){ // this was unclosed

 

   Event.stop(event);

   } // now closed properly

 var the_id = elm.id.split('_').last();

  alert(the_id);  // remove this to make it work

return; // remove this to make it work

   new Ajax.Request('remove_clone.php',{

 parameters:{clone:the_id},

 onSuccess:function(transport){

   elm.up('li').remove();

   pollSortable.defer();

 }

   });

});

 

   That works because i just tested it, it alerts 1234 for the  

  follwing html

   and 4567 for the second list element.

 

   See the comments in the code to make it work for you.

 

   ul id=clones

   li id=foo_1234ID = foo_1234/li

li id=foo_4567ID = foo_4567 /li

 /ul

 

   Alex Mcauleyhttp://www.thevacancymarket.com

 

   - Original Message -

   From: Yan Kovyakh maybe...@gmail.com

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 5:17 PM

   Subject: [Proto-Scripty] Delete php

 

Says nothing, it's unclick-able now.

 

   and firebug says ?

 

   you have an undefined error in there for a start with evt.stop();

 

   Alex Mcauley

   http://www.thevacancymarket.com

   - Original Message -

   From: Yan Kovyakh maybe...@gmail.com

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 5:04 PM

   Subject: [Proto-Scripty] Delete php

 

Both of the solutions causes script not to work at all, just to  

  make

sure  I'm connecting all right.

   http://jsbin.com/igixe/edit

 

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 Mcauleyhttp://www.thevacancymarket.com

 

- Original Message -

From: Yan Kovyakh maybe...@gmail.com

To: prototype-scriptaculous@googlegroups.com

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 wa...@wdstudio.com

 To: prototype-scriptaculous@googlegroups.com

 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


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh

In the post of remove_clone.php I see clone theIDnumber in response tab
see nothing...

change

elm.up('li').remove();

to
$(this).remove();

and it will remove the element that was clicked

Alex Mcauley
http://www.thevacancymarket.com
- Original Message - 
From: Walter Lee Davis wa...@wdstudio.com
To: prototype-scriptaculous@googlegroups.com
Sent: Tuesday, July 21, 2009 7:53 PM
Subject: [Proto-Scripty] Re: Delete php



 What does Firebug say your return from Ajax.Request looks like? You
 should be able to see it in the Console tab, you'll see a POST and
 then the response from that.

 Walter

 On Jul 21, 2009, at 2:31 PM, Yan Kovyakh wrote:

 Alert works up to the last 2 lines, up to the elm.up('li').remove();

 Try console.log(elm.up('li')) and see what you get in Firebug, that
 should return the HTML for your list item if there is an enclosing LI
 element around elm. If elm is the link (not the li) then you should be
 golden.



 
 





--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh

I do see the real ID of an item, no errors, nothing changed since adding the
code you've gave. And again in the firebug XHR tab for the POST
remove_clone.php in the tab Post I see clone theRealID without  of
course. Nothing in HTML or Response tabs.


Do you actually see the real ID number, or do you see 'theIDnumber'?

Can you turn on error reporting in your remove_clone.php?

ini_set('display_errors',1);
error_reporting(E_ALL);

As close to the top of the PHP script as you can get it.

Walter

On Jul 21, 2009, at 2:58 PM, Yan Kovyakh wrote:


 In the post of remove_clone.php I see clone theIDnumber in response 
 tab see nothing...

 change

 elm.up('li').remove();

 to
 $(this).remove();

 and it will remove the element that was clicked

 Alex Mcauley
 http://www.thevacancymarket.com
 - Original Message -
 From: Walter Lee Davis wa...@wdstudio.com
 To: prototype-scriptaculous@googlegroups.com
 Sent: Tuesday, July 21, 2009 7:53 PM
 Subject: [Proto-Scripty] Re: Delete php



 What does Firebug say your return from Ajax.Request looks like? You 
 should be able to see it in the Console tab, you'll see a POST and 
 then the response from that.

 Walter

 On Jul 21, 2009, at 2:31 PM, Yan Kovyakh wrote:

 Alert works up to the last 2 lines, up to the elm.up('li').remove();

 Try console.log(elm.up('li')) and see what you get in Firebug, that 
 should return the HTML for your list item if there is an enclosing LI 
 element around elm. If elm is the link (not the li) then you should 
 be golden.










 





--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-21 Thread Yan Kovyakh
WOW Great! Though it's still aren't removing the link dynamically:
elm.up('li').remove(); neither by: $(this).remove();

Thanks for the amazing support so far!

 

 its $_POST['clone']

 

 not $_POST['the_id']

 

 thats why !!

 Alex Mcauleyhttp://www.thevacancymarket.com

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Tuesday, July 21, 2009 10:22 PM

   Subject: [Proto-Scripty] Delete php

 

   I don't know whether I'll be able to find a problem as I'm not that good
in Javascript, but just to be on the safe side.

 

   Here's again the script:http://pastie.org/554101

 

   And the remove_clone:http://pastie.org/554099

 

   Thanks,

 

Can you make a regular POST to the delete script (using a test form)  

 

and see if it responds in any way? I remain convinced that your  

 

problem is in that script, nowhere else.

 

Walter

 

On Jul 21, 2009, at 4:01 PM, Yan Kovyakh wrote:

 

 I do see the real ID of an item, no errors, nothing changed since  

 

 adding the

 

 code you've gave. And again in the firebug XHR tab for the POST

 

 remove_clone.php in the tab Post I see clone theRealID without 
of

 

 course. Nothing in HTML or Response tabs.

 

 Do you actually see the real ID number, or do you see
'theIDnumber'?

 

 Can you turn on error reporting in your remove_clone.php?

 

 ini_set('display_errors',1);

 

 error_reporting(E_ALL);

 

 As close to the top of the PHP script as you can get it.

 

 Walter

 

 On Jul 21, 2009, at 2:58 PM, Yan Kovyakh wrote:

 

 In the post of remove_clone.php I see clone theIDnumber in
response

 

 tab see nothing...

 

 change

 

 elm.up('li').remove();

 

 to

 

 $(this).remove();

 

 and it will remove the element that was clicked

 

 Alex Mcauley

 

http://www.thevacancymarket.com

 

 - Original Message -

 

 From: Walter Lee Davis wa...@wdstudio.com

 

 To: prototype-scriptaculous@googlegroups.com

 

 Sent: Tuesday, July 21, 2009 7:53 PM

 

 Subject: [Proto-Scripty] Re: Delete php

 

 What does Firebug say your return from Ajax.Request looks like?
You

 

 should be able to see it in the Console tab, you'll see a POST and

 

 then the response from that.

 

 Walter

 

 On Jul 21, 2009, at 2:31 PM, Yan Kovyakh wrote:

 

 Alert works up to the last 2 lines, up to the  

 

 elm.up('li').remove();

 

 Try console.log(elm.up('li')) and see what you get in Firebug,
that

 

 should return the HTML for your list item if there is an enclosing


 

 LI

 

 element around elm. If elm is the link (not the li) then you
should

 

 be golden.


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-20 Thread Yan Kovyakh
So I have some kind of Ajax callback to a php, when you click a certain
thing. I don't know how to set the delete php so It will delete the row from
the table. Can somebody share it?

 



$('clones').observe('click',function(evt){

  var elm = evt.element();

  if (elm.hasClassName('remove')){

evt.stop();

 

var id = elm.id.split('_').last();

new Ajax.Request('remove_clone.php',{

  parameters:{clone:id},

  onSuccess:function(transport){

elm.up('li').remove();

pollSortable.defer();

  }

});

 




--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-20 Thread Yan Kovyakh
Seems like something is wrong, maybe it's not sending the id at all, when I
look at it in firebug XHR at the POST remove_clone.php in the post tab I see
clone, shouldn't there be a value to for the id? 


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-20 Thread Yan Kovyakh
It's the new element that gets created:

 

var clone = new Element('li', {style: 'position: relative'}); 

clone.id = transport.responseText;

 

It's ripped of the script, tell me if you need more.


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-20 Thread Yan Kovyakh
They actualy have Item_numericalID

Is this the problem?


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-20 Thread Yan Kovyakh
Ya, I'm getting an empty box, so something is wrong. 

 

 

 Dude, firstly please stop topping the message and removing the code and
replies from your replies.

 

 secondly: try the below script and see what gets alerted (it should be
your numeric ID, if not then you have something wrong somewhere

 

 $('clones').observe('click',function(evt){

 

   var elm = evt.element();

 

   if (elm.hasClassName('remove')){

 

 evt.stop();

 

 var id = elm.id.split('_').last();

 

 alert(id);

 

 return;

 

 new Ajax.Request('remove_clone.php',{

 

   parameters:{clone:id},

 

   onSuccess:function(transport){

 

 elm.up('li').remove();

 

 pollSortable.defer();

 

   }

 

 });

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Monday, July 20, 2009 7:35 PM

   Subject: [Proto-Scripty] Delete php

 

   They actualy have Item_numericalID

 

   Is this the problem?


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-20 Thread Yan Kovyakh
Ya, I'm getting an empty box, so something is wrong.

 

On Jul 20, 10:18 pm, Alex McAuley webmas...@thecarmarketplace.com wrote:

 Dude, firstly please stop topping the message and removing the code and
replies from your replies.

 

 secondly: try the below script and see what gets alerted (it should be
your numeric ID, if not then you have something wrong somewhere

 

 $('clones').observe('click',function(evt){

 

   var elm = evt.element();

 

   if (elm.hasClassName('remove')){

 

 evt.stop();

 

 var id = elm.id.split('_').last();

 

 alert(id);

 

 return;

 

 new Ajax.Request('remove_clone.php',{

 

   parameters:{clone:id},

 

   onSuccess:function(transport){

 

 elm.up('li').remove();

 

 pollSortable.defer();

 

   }

 

 });

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Monday, July 20, 2009 7:35 PM

   Subject: [Proto-Scripty] Delete php

 

   They actualy have Item_numericalID

 

   Is this the problem?


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Delete php

2009-07-20 Thread Yan Kovyakh
Ya, I'm getting an empty box, so something is wrong.

 

 Dude, firstly please stop topping the message and removing the code and 

replies from your replies.

 

 secondly: try the below script and see what gets alerted (it should be

your numeric ID, if not then you have something wrong somewhere

 

 $('clones').observe('click',function(evt){

 

   var elm = evt.element();

 

   if (elm.hasClassName('remove')){

 

 evt.stop();

 

 var id = elm.id.split('_').last();

 

 alert(id);

 

 return;

 

 new Ajax.Request('remove_clone.php',{

 

   parameters:{clone:id},

 

   onSuccess:function(transport){

 

 elm.up('li').remove();

 

 pollSortable.defer();

 

   }

 

 });

 

   - Original Message -

   From: Yan Kovyakh

   To: prototype-scriptaculous@googlegroups.com

   Sent: Monday, July 20, 2009 7:35 PM

   Subject: [Proto-Scripty] Delete php

 

   They actualy have Item_numericalID

 

   Is this the problem?


--~--~-~--~~~---~--~~
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 prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---