Newbie:: When Item selected in a drop down selecting menu

Hi,

How could I refresh a a page when selected and iteam from a drop down
selecting menu?

Please help.

Thanks

Ruwan B. wrote:

Hi,

How could I refresh a a page when selected and iteam from a drop down
selecting menu?

Please help.

Thanks

Any help pls?

Hi what you could do is something like this

Drop down

<select name="drop_down" id="drop_down" onchange="<%= remote_function( :url => { :action => :refresh_page }, :with => "'drop_down_selection='+this.value" ) %>"> <% @options_for_drop_down.each do |drop| %> <option value="<%= drop.id %>"> <%= drop.name %> </option> <% end %> </select> <p>then either use an action in your controller to set stuff up and then<br> render an rjs template or just render the rjs template directly with<br> something like</p> <p>page.replace_html ‘rest_of_page_container’, :partial => ‘rest_of_page’</p> <p>i.e. use ajax to refresh content.<br> Also if you go down this route i suggest that you keep an eye on your<br> logs and install firebug which is a javascript debbugging plugin for<br> firefox. Don’t worry tho , you can do alot of ajax only using the rails<br> helpers.<br> This is how i do something similar although i’m very new to rails so i’m<br> sure there are better ways.<br> cheers<br> c</p> <p>Ruwan B. wrote:</p> <blockquote> <p>Ruwan B. wrote:</p> <blockquote> <p>Hi,</p> <p>How could I refresh a a page when selected and iteam from a drop down<br> selecting menu?</p> <p>Please help.</p> <p>Thanks</p> </blockquote> <p>Any help pls?</p> </blockquote>