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.
DelT (Guest)
on 2009-05-22 11: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
kittu.py (Guest)
on 2009-05-22 14: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 ?
侯远 (Guest)
on 2009-05-25 13:03
(Received via mailing list)
2009/5/22 kittu.py <removed_email_address@domain.invalid>

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

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