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