Pass variables inside the page

Hi!

I need to create a combobox which , depending on the selected value, will display different items whithout reloading the page

<%= select("product","choice", Pricebooks.find(:all).collect { |p| [p.name,p.id]}, {:selected => Pricebooks.find(:first)} , {onchange => ???)%>

How can i retrieve the value of the selected product through onchange?

is this entirely client side or do you want to make an ajax request ?

Fred

Frederick Cheung wrote:

That’s pure JS then.

onChange(this), and treat it accordingly…

oops. onChange(yourFunction(this));

well, you can submit a classic form request and reload the whole page, or submit an ajax request and then update just a part of your page. I think that you should decide what you want do, then hack this solution. Not decide what you want to do because it seems simpler to do.