# How to get selected value from select\_tag with params in remote\_function's url?

**URL:** <https://www.ruby-forum.com/t/how-to-get-selected-value-from-select-tag-with-params-in-remote-functions-url/168550>\
**Category:** Rails\
**Created:** [May 22, 2009, 9:13am UTC](https://www.ruby-forum.com/t/how-to-get-selected-value-from-select-tag-with-params-in-remote-functions-url/168550 "2009-05-22T09:13:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DelT](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c6cbf5/32.png) [@DelT](https://www.ruby-forum.com/u/DelT)\
**Post date:** [May 22, 2009, 9:13am UTC](https://www.ruby-forum.com/t/how-to-get-selected-value-from-select-tag-with-params-in-remote-functions-url/168550/1 "2009-05-22T09:13:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DelT](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c6cbf5/32.png) [@DelT](https://www.ruby-forum.com/u/DelT)\
**Post date:** [May 22, 2009, 12:31pm UTC](https://www.ruby-forum.com/t/how-to-get-selected-value-from-select-tag-with-params-in-remote-functions-url/168550/2 "2009-05-22T12:31:03Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![DelT](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c6cbf5/32.png) [@DelT](https://www.ruby-forum.com/u/DelT)\
**Post date:** [May 25, 2009, 11:03am UTC](https://www.ruby-forum.com/t/how-to-get-selected-value-from-select-tag-with-params-in-remote-functions-url/168550/3 "2009-05-25T11:03:38Z")

</div>

2009/5/22 kittu.py [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

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

THX,but I try to paginate with ajax
