Update href, on drop down menu selection change


Hi there,

I have a drop down menu that looks like this:

10 15 20 25 30

I also have some links that need to take dynamically the value of the
option selected in the above drop down menu, so that this value can be
passed as a parameter to my rails application, when the user clicks a
link. For example, my links look like these:


Bar Area


What I would like to achieve, is dynamically updating the value of the
“results_per_page” parameter in those links, whenever the user selects a
different option from the drop down menu. So, for example, when the page
is first loaded, the value of the variable will be ‘10’ and then when
the user selects, say, option ‘20’, this variable will be updated
dynamically to ‘20’.
This way, when one of the above links will be clicked, the right
parameter value will be passed to my rails app.

I’ve tried using plain old JavaScript with ‘onchange’ as well as Ajax
with an rjs template, to no avail. Any ideas??

Many thanks in advance,