thnx 4 da response. understood the code. um admired.

Here let me also add one another thing, i.e. from the source fetcher
file in this case results.htm suppose there two different outputs
which are later going to be updated in two different divs in the
caller script. um using php as server side language, lets suppose from
the ajax fetcher file (results.php for php), there are two sets of
output um representing as output1, output2. right? now after that one
and only ajax call output1 is going 2 be updated in div1 and output2
in div2.

can this b possible?

Can u give me some rings in this regard?

Thanks again
Suvro

On Tue, Nov 25, 2008 at 10:17 PM, Miguel Beltran R. <[EMAIL PROTECTED]> wrote:
>
>
> 2008/11/21 tushersuvro <[EMAIL PROTECTED]>
>>
>> Hey. Everyone! how r u?
>>
>> um having trouble in updating two container (ids) in one ajax call.
>> the function here I use is protoype's updater function.
>>
>> Suppose there is two ids
>>
>> <div id="1">somethinf</div>
>>
>> there are some code here. there are some code here. there are some
>> code here. there are some code here. there are some code here. there
>> are some code here. there are some code here. there are some code
>> here. there are some code here. there are some code here.
>>
>> <div id="2">another bunch of code</div>
>>
>> <form name="samplefrm" method="post" action="javascript:get
>> (document.getElementById('samplefrm'));">
>
> change to
>
> <form name="samplefrm" id="samplefrm" method="post" action="results.htm">
>
>>
>> <input type="text" name="textfield" id="textfield" value />
>> <input type="button" name="srch" value="submit"  />
>>
>> </form>
>>
>> Now from the if submit button is pressed, two ids in above will be
>> updated with two different contents with one ajax call. can it be done
>> with prototype?
>>
>> Thnaks. Tushersuvro
>
> Yes, can do it
>
> check "onSuccess"
>
> something like this
>
> <script type="text/javascript">
>
>
> window.observe('dom:loaded', function (){
>    $('samplefrm').observe('submit', function(evt){
>      var req=$('samplefrm').request({
>          onSuccess: function(response){
>             $('div1').update("some value");
>             $('div2').update("other value");
>          }
>      })
>    })
> })
> </script>
>
>
>
> --
> ________________________________________
> Lo bueno de vivir un dia mas
> es saber que nos queda un dia menos de vida
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to