DelT
2009-May-22 02:07 UTC
How to get selected value from select_tag with params in remote_function''s url?
select_tag("skippage", options_for_select ((first_page..last_page).to_a), :onchange => remote_function(:update => update, :url => {:controller => ''user'' , :action => :list , :offset => ????? }, :complete => visual_effect(:highlight, "showdb" ))) #:complete => "alert($(''skippage'').getValue())")) I want to send selected value to parms[:offset],but i dont know how to get the value $(''skippage'').getValue() Only can use in the :complete,and it alert the selected value successfully Thanks
kittu.py
2009-May-22 08:39 UTC
Re: How to get selected value from select_tag with params in remote_function''s url?
add an extra options :with => "''offset=''+this.value" that should solve the problem; if what you''re doing this for pagination, why not use will_paginate ? On May 22, 7:07 am, DelT <houyuan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> select_tag("skippage", > options_for_select > ((first_page..last_page).to_a), > :onchange => remote_function(:update => > update, > :url => > {:controller => ''user'' , > :action > => :list , > :offset > => ????? }, > > :complete > => visual_effect(:highlight, "showdb" ))) > > #:complete => "alert($(''skippage'').getValue())")) > > I want to send selected value to parms[:offset],but i dont know how to > get the value > > $(''skippage'').getValue() Only can use in the :complete,and it alert > the selected value successfully > > Thanks
侯远
2009-May-25 09:02 UTC
Re: How to get selected value from select_tag with params in remote_function''s url?
2009/5/22 kittu.py <kittu.info-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>> > add an extra options :with => "''offset=''+this.value" > that should solve the problem; > > if what you''re doing this for pagination, why not use will_paginate ? > > On May 22, 7:07 am, DelT <houyuan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > select_tag("skippage", > > options_for_select > > ((first_page..last_page).to_a), > > :onchange => remote_function(:update => > > update, > > :url => > > {:controller => ''user'' , > > :action > > => :list , > > :offset > > => ????? }, > > > > :complete > > => visual_effect(:highlight, "showdb" ))) > > > > #:complete => "alert($(''skippage'').getValue())")) > > > > I want to send selected value to parms[:offset],but i dont know how to > > get the value > > > > $(''skippage'').getValue() Only can use in the :complete,and it alert > > the selected value successfully > > > > Thanks > > > >THX,but I try to paginate with ajax --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---