[Proto-Scripty] Re: update two container by one ajax call
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=1somethinf/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=2another 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 -~--~~~~--~~--~--~---
[Proto-Scripty] Re: update two container by one ajax call
Sorry, forgot the thread URL. [1] http://groups.google.com/group/prototype-scriptaculous/browse_thread/thread/9dbd642d6e625cff?hl=en Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] On Tue, Nov 25, 2008 at 2:34 PM, Gabriel Gilini [EMAIL PROTECTED]wrote: On Tue, Nov 25, 2008 at 2:17 PM, Miguel Beltran R. [EMAIL PROTECTED]wrote: [snip] script type=text/javascript window.observe('dom:loaded', function (){ Just change this to document.observe('dom:loaded', function(){ As seen in a thread[1] a few days back, dom:loaded is a document event. [snip] Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[Proto-Scripty] Re: update two container by one ajax call
On Tue, Nov 25, 2008 at 2:17 PM, Miguel Beltran R. [EMAIL PROTECTED]wrote: [snip] script type=text/javascript window.observe('dom:loaded', function (){ Just change this to document.observe('dom:loaded', function(){ As seen in a thread[1] a few days back, dom:loaded is a document event. [snip] Gabriel Gilini www.usosim.com.br [EMAIL PROTECTED] [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---