I''m sorry if this is a stupid question but I''m totally swamped. I have a view where I have 2 radio_buttons with corresponding selection box below each. Initially I want the user only to see the two radio_buttons next to the google map I''m showing. When the user selects one of the radio_buttons the corresponding select box is shown. This must all happen without the action having to go to the controller. Both select boxes however as shown when the page loads and in IE6 I get an error mesg “Form is undefined” Can I even do what I want to accomplish? Sorry that is what happens when a mainframe programmer starts playing around programming for the web, he gets very very lost note: The ID names I use in the code below I got from viewing the source after attempting various other variations. I even gave the radio_buttons and select boxes ID names. But that did not work either. Thanks for your time. Here is the code in my view: <%= GMap.header -%> <%= render :partial => ''garage'', :collection => @garages %> <% form_for :garage_map, :url => { :action => :index } do |f| %> <script src="prototype-1.5.0.js"></script> <fieldset> <legend>Show on the Map</legend> <p><%= f.radio_button :filter, :garage %>A specific garage</p> <p><%= f.collection_select(:name, @garages, :id, :name) %></p> <p><%= f.radio_button :filter, :make %>All garages for a make of car</p> <p><%= f.select(:car_make, garage::CAR_MAKES) %></p> </fieldset> <p><%= submit_tag "Show Selection", :class => "submit" %></p> <% end %> <%= observe_field :garage_map_filter_garage, :frequency => 0, :before => "Element.hide(''garage_map_name'')", :complete => "Element.show(''garage_map_name'')" %> <%= observe_field :garage_map_filter_make, :frequency => 0, :before => "Element.hide(''garage_map_car_make'')", :complete => "Element.show(''garage_map_car_make'')" %> <%= @map.to_html %> My applogies if you saw this post over at railsforum as well but I''m desperate ! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Johannes De jong wrote:> I''m sorry if this is a stupid question but I''m totally swamped.Off course I stumped and not swamped :-) -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I think it''s the radio button u.i. paradigm that makes this difficult with or without Rails. For example: If you click a radio button form element twice it should stay selected, and it''s exclusive representation (specific garages) is maintained within the mutual radio button group (by garage or by make). If you had an image with link_to_remote the image could be toggled with each click, such as a triangle pointing to the right or down or a faux radio button. With this implementation you could still maintain the mutual exclusion with multiple calls to multiple elements at once (show one and hide the other) while also allowing for none to be in a selected state. Perhaps if there''s a working radio button example somewhere to base on it would be easier to say how it can be done in Rails. If you can avoid using radio buttons though I think it''ll be much easier. Dan Poynor -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Dan thanks for taking the time to reply. But with the help from Ryan over at Railsforum I managed to solve my problem. I was barking up the wrong tree, using Element.hide() en Element.show() solved my problem. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---