Yes 'complete' actions must use the Javascript API provided by Prototype JS.

Regards

Deepak Bhatia

On Thu, Dec 17, 2009 at 7:00 PM, tirengarfio <tirengar...@gmail.com> wrote:

> I just want to add that it only works using the prototype function
> (toggleClassName()), not with this other options:
>
> 'complete' => 'document.getElementById("message_1").className
> ("read_message");',
> 'complete' => "document.getElementById('message_1').className
> ('read_message');",
>
>
> <?php echo javascript_tag("
>  function myfunction()
>  {
>
>
>       document.getElementById('message_1').className('read_message');
>
>
>  }
> ") ?>
>
> 'complete' => 'myfunction()',
>
>
> Regards
>
> Javi
>
>
> On Dec 17, 12:14 pm, tirengarfio <tirengar...@gmail.com> wrote:
> > OK: only one 'complete' option. Now works!
> >
> > Thanks
> >
> > Javi
> >
> > On Dec 17, 11:32 am, Gareth McCumskey <gmccums...@gmail.com> wrote:
> >
> > > FYI, you cannot have two array keys with a name of complete....
> >
> > > Also, is the link you are trying to create rendered via an ajax call as
> well, possibly because of another previous link_to_remote? If so make sure
> the first one has the "script"=>true option set:
> >
> > > link_to_remote('Link Text', array(
> > >   "url"=>"urltoload",
> > >   "update"=>"divtoupdate",
> > >   "script"=>true
> >
> > > ----- Original Message -----
> > > From: "tirengarfio" <tirengar...@gmail.com>
> > > To: "symfony users" <symfony-users@googlegroups.com>
> > > Sent: Thursday, December 17, 2009 11:19:40 AM GMT +02:00 Harare /
> Pretoria
> > > Subject: [symfony-users] Re: Question about link_to_remote: 'complete'
> option
> >
> > > So.. what should i do?
> >
> > > As i say in my first post i dont have any problems with
> > > link_to_function('Link', "myfunction2()")...
> >
> > > Javi
> >
> > > On Dec 17, 7:06 am, DEEPAK BHATIA <toreachdee...@gmail.com> wrote:
> > > > This means your javascript code is not getting executed.
> >
> > > > On Wed, Dec 16, 2009 at 11:14 PM, tirengarfio <tirengar...@gmail.com>
> wrote:
> > > > > I have this:
> >
> > > > > <?php echo javascript_tag("
> > > > >  function myfuncion1()
> > > > >  {
> > > > >   alert('Test');
> > > > >  }
> > > > > ") ?>
> >
> > > > > <div class="non_read_message" id="message_1">
> >
> > > > >    <?php echo link_to_remote('Already read it', array(
> >
> > > > >        'url' => 'mensaje/cambiarEstadoLeido',
> >
> > > > >        'update' => 'message_1',
> >
> > > > >        'complete' => 'myfunction1()',
> >
> > > > >        'loading' => visual_effect(''),
> >
> > > > >        'complete'=> visual_effect(''),
> >
> > > > >    )); ?>
> >
> > > > > </div>
> >
> > > > > The javascript window with the word "Test" is not showed after
> > > > > clicking on the link.
> >
> > > > > Javi
> >
> > > > > On Dec 16, 3:33 pm, DEEPAK BHATIA <toreachdee...@gmail.com> wrote:
> > > > > > try putting alert("Test") in front of it.
> >
> > > > >  > On Wed, Dec 16, 2009 at 6:40 PM, tirengarfio <
> tirengar...@gmail.com>
> > > > > wrote:
> > > > > > > Thanks Deepak, but it didn't work..
> >
> > > > > > > Javi
> >
> > > > > > > On Dec 16, 1:42 pm, DEEPAK BHATIA <toreachdee...@gmail.com>
> wrote:
> > > > > > > > Try this
> >
> > > > > > > >  'complete' =>
> > > > > > > >
> "document.getElementById('message_1').className('read_message')",
> >
> > > > > > >  > On Mon, Dec 14, 2009 at 5:38 PM, tirengarfio <
> tirengar...@gmail.com
> >
> > > > > > > wrote:
> > > > > > > > > Hi,
> >
> > > > > > > > > i want to change the class of a <div> after clicking a
> link. In the
> > > > > > > > > same time i would like to execute a symfony action. For
> that, im
> > > > > using
> > > > > > > > > link_to_remote this way:
> >
> > > > > > > > > <div class="non_read_message" id="message_1">
> >
> > > > > > > > >    Message's content
> >
> > > > > > > > >        <div class="footer">
> >
> > > > > > > > >             <?php echo link_to_remote('Already read it',
> array(
> > > > > > > > >                                'url' =>
> > > > > 'mensaje/cambiarEstadoLeido,
> >
> > > > > > > > >                                'update' => 'message_1',
> >
> > > > > > > > >                                'complete' =>
> > > > > 'document.getElementById
> > > > > > > > > ("message_1").className("read_message");',
> >
> > > > > > > > >                )); ?>
> >
> > > > > > > > >        </div>
> >
> > > > > > > > > </div>
> >
> > > > > > > > > My problem: after clicking on the link the class of the div
> doesn't
> > > > > > > > > change...
> >
> > > > > > > > > I don't have any problem using link_to_function and a .js
> file.
> >
> > > > > > > > > Any idea?
> >
> > > > > > > > > Regards
> >
> > > > > > > > > Javi
> >
> > > > > > > > > --
> >
> > > > > > > > > You received this message because you are subscribed to the
> Google
> > > > > > > Groups
> > > > > > > > > "symfony users" group.
> > > > > > > > > To post to this group, send email to
> > > > > symfony-us...@googlegroups.com.
> > > > > > > > > To unsubscribe from this group, send email to
> > > > > > > > > symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> <symfony-users%2bunsubscr...@googlegroups.com<symfony-users%252bunsubscr...@googlegroups.com>
> >
> > > > > <symfony-users%2bunsubscr...@googlegroups.com<symfony-users%252bunsubscr...@googlegroups.com>
> <symfony-users%252bunsubscr...@googlegroups.com<symfony-users%25252bunsubscr...@googlegroups.com>
> >
> >
> > > > > > > <symfony-users%2bunsubscr...@googlegroups.com<symfony-users%252bunsubscr...@googlegroups.com>
> <symfony-users%252bunsubscr...@googlegroups.com<symfony-users%25252bunsubscr...@googlegroups.com>
> >
> > > > > <symfony-users%252bunsubscr...@googlegroups.com<symfony-users%25252bunsubscr...@googlegroups.com>
> <symfony-users%25252bunsubscr...@googlegroups.com<symfony-users%2525252bunsubscr...@googlegroups.com>
> >
> >
> > > > > > >  > > .
> > > > > > > > > For more options, visit this group at
> > > > > > > > >http://groups.google.com/group/symfony-users?hl=en.
> >
> > > > > > > --
> >
> > > > > > > You received this message because you are subscribed to the
> Google
> > > > > Groups
> > > > > > > "symfony users" group.
> > > > > > > To post to this group, send email to
> symfony-us...@googlegroups.com.
> > > > > > > To unsubscribe from this group, send email to
> > > > > > > symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> <symfony-users%2bunsubscr...@googlegroups.com<symfony-users%252bunsubscr...@googlegroups.com>
> >
> > > > > <symfony-users%2bunsubscr...@googlegroups.com<symfony-users%252bunsubscr...@googlegroups.com>
> <symfony-users%252bunsubscr...@googlegroups.com<symfony-users%25252bunsubscr...@googlegroups.com>
> >
> >
> > > > > > > .
> > > > > > > For more options, visit this group at
> > > > > > >http://groups.google.com/group/symfony-users?hl=en.
> >
> > > > > --
> >
> > > > > You received this message because you are subscribed to the Google
> Groups
> > > > > "symfony users" group.
> > > > > To post to this group, send email to
> symfony-us...@googlegroups.com.
> > > > > To unsubscribe from this group, send email to
> > > > > symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> <symfony-users%2bunsubscr...@googlegroups.com<symfony-users%252bunsubscr...@googlegroups.com>
> >
> > > > > .
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/symfony-users?hl=en.
> >
> > > --
> >
> > > You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> > > To post to this group, send email to symfony-us...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> .
> > > For more options, visit this group athttp://
> groups.google.com/group/symfony-users?hl=en.
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "symfony users" group.
> To post to this group, send email to symfony-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en.
>
>
>

--

You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to