Hi, I have 3 chained select (not sequential) and I tried to create 3 observers in order to change select contents dynamically in this way: [code] Event.observe(document.getElementById(this.searchItem1),''change'',this.updateSearchResults1.bindAsEventListener(this)); Event.observe(document.getElementById(this.searchItem2),''change'',this.updateSearchResults2.bindAsEventListener(this)); Event.observe(document.getElementById(this.searchItem3),''change'',this.updateSearchResults3.bindAsEventListener(this)); [/code] When I change the value of 1 of the 3 select the code in the function updateSearchResultsX is executed and in continues working everytime i change the value of the same select. When I try to change 1 of the other select values(after the first change) the observer doesn''t seem to work infact nothing happens. Can you please help me???? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
what does this.updateSearchResults1 do? On 11/15/07, Mescal <rudemescal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi, > I have 3 chained select (not sequential) and I tried to create 3 > observers in order to change select contents > dynamically in this way: > > [code] > Event.observe(document.getElementById(this.searchItem1),''change'', > this.updateSearchResults1.bindAsEventListener(this)); > > Event.observe(document.getElementById(this.searchItem2),''change'', > this.updateSearchResults2.bindAsEventListener(this)); > Event.observe(document.getElementById(this.searchItem3),''change'', > this.updateSearchResults3.bindAsEventListener(this)); > [/code] > > When I change the value of 1 of the 3 select the code in the function > updateSearchResultsX is executed and in continues working everytime i > change the value of the same select. > > When I try to change 1 of the other select values(after the first > change) the observer doesn''t seem to work infact nothing happens. > > Can you please help me???? > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
hi Gareth Evans, thanks for reply [code] updateSearchResults1: function() { //only make the request if we''re not in the middle of searching if(Ajax.activeRequestCount == 0) { var pars =''select1=''+ $F(''select1'')+''&select2=''+ $F(''select2'') +''&select3=''+ $F(''select3''); //var pars = this.nomeParametro + ''='' + $F(this.searchItem); pars+= ''&tmp=''+Math.random(); var url2 ="select2.php"; var url3 ="select3.php"; //show the activity indicator $(this.activityItem).style.display = ''''; //make the ajax request var myAjax = new Ajax.Request(url2,{method: ''post'',parameters: pars,onComplete: this.handleSearch2.bind(this)}); var myAjax1 = new Ajax.Request(url3,{method: ''post'',parameters: pars,onComplete: this.handleSearch3.bind(this)}); } }, [/code] and handleSearch2 and handleSearch3 [code] handleSearch2: function(originalRequest) { //parse the results $(this.resultsItem2).innerHTML = originalRequest.responseText; //hide the activity indicator $(this.activityItem).style.display = ''none''; }, handleSearch3: function(originalRequest) { //parse the results $(this.resultsItem3).innerHTML = originalRequest.responseText; //hide the activity indicator $(this.activityItem).style.display = ''none''; } [/code] help me please!!!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
up --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---