can you either post the HTML that you are using or post the url where it is
located publicly?


you can simplify your javascript this way


$$('td a.delete').each(function(s){
    s.observe('click', confirmDelete);
  } );


Jason Westbrook | T: 313-799-3770 | jwestbr...@gmail.com



On Wed, Jul 11, 2012 at 9:26 AM, thinsoldier <thinsold...@gmail.com> wrote:

> Hello.
>
> I have a page that lists records and each row has a link that goes to a
> page which deletes the associated record.
>
> But before the browser navigates to that page I stop it by asking the user
> if they really want to delete the item.
>
> If they click cancel the browser goes nowhere.
> If they click OK the browser navigates to the php file that deletes the
> record.
>
> My problem is that after the confirm() UI appears and is clicked, it
> appears AGAIN, then when I click again does the expected behaviour occur.
>
> What is causing that in this code?
>
> document.observe("dom:loaded", function() {
>   // attach to all delete links in the table
>   var dels = $$('td a.delete');
>   dels.each(function(s){
>     s.observe('click', function(event){ confirmDelete(event); }  );
>   } )
> });
>
>
> function confirmDelete(event)
> {
>     var ask = confirm('Are you sure you want to delete this entry?');
>
>     if(ask){ xfoo = 'follow link - delete it'; }
>     else{ event.stop();  xfoo =' do nothing - stop event ';      }
> }
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/prototype-scriptaculous/-/qwdMPG_i8WMJ.
> 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.
>

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

Reply via email to