Forum: Ruby on Rails How to get selected value from select_tag with params in remote_function's url?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A03e41cd99f2bd3d8be18407087aa436?d=identicon&s=25 DelT (Guest)
on 2009-05-22 09:13
(Received via mailing list)
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
86121facb1e1bb82e220ddbb67b32ec8?d=identicon&s=25 kittu.py (Guest)
on 2009-05-22 12:31
(Received via mailing list)
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 ?
A03e41cd99f2bd3d8be18407087aa436?d=identicon&s=25 侯远 (Guest)
on 2009-05-25 11:03
(Received via mailing list)
2009/5/22 kittu.py <kittu.info@gmail.com>

> >                         :onchange => remote_function(:update =>
> >
> >
>

THX,but I try to paginate with ajax
This topic is locked and can not be replied to.