Hi Laura,

<script type="text/javascript">
function executeWhenFinished(request)
{
    Element.replace('othercontainer_id',$F('badgeHolder'));

    // put other container updates here
}
</script>

Good luck,


Pedro

On Tue, Aug 19, 2008 at 5:38 PM, laura <[EMAIL PROTECTED]> wrote:
>
> hi pedro-
>
> bear with me, since i'm pretty new to ajax. can you give me an example
> of what would go in 'executeWhenFinished(request)'?
>
> l.
>
>
>
> On Aug 19, 5:15 pm, "Pedro Bastos" <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I can see two possible solutions for your question:
>>
>> a) Set a handler on your Ajax.Update object. Insert complete in your
>> options. Eg:
>>
>> <?php echo form_remote_tag(array(
>>   'update'   => 'badgeHolder',
>>   'url'      => '@login_badge',
>>   'complete' => 'executeWhenFinished(request)'
>>  )) ?>
>>
>>  Then you have to create a javascript handler to update any DOM object.
>>
>> b) Set a global Ajax handler. Insert this BEFORE you execute Ajax.Updater:
>>
>> Ajax.Responders.register({
>>   onComplete: function(){
>>     // handle all Ajax requests
>>   }
>>
>> });
>>
>> This will handle ALL xmlHttpRequest requests made in your page.
>>
>> I suggest you to use the first one. It is clean and easy.
>>
>> Questions? Reply back. :)
>>
>> Pedro
>>
>>
>>
>> On Tue, Aug 19, 2008 at 1:29 PM, laura <[EMAIL PROTECTED]> wrote:
>>
>> > hi-
>>
>> > i've seen this type of question posted elsewhere, but haven't been
>> > able to figure out how to do it. i have a form_remote_tag that logs a
>> > user into our site. upon login, it updates the login div to be a
>> > logged-in div. but, i also have a component at the top of the page
>> > that needs to be updated:
>>
>> > <?php echo form_remote_tag(array(
>> >  'update'   => 'badgeHolder',
>> >  'url'      => '@login_badge',
>> > )) ?>
>>
>> > there other div has a component in it that would need to be swapped
>> > out upon logging in.
>>
>> > so to summarize, how would i update 2 components upon submitting the
>> > form?
>>
>> > thanks!
>>
>> > laura- Hide quoted text -
>>
>> - Show quoted text -
> >
>

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

Reply via email to