Not sure if I’m asking this question properly, but here’s what I’m trying to do:
-
Select an event from a dropdown list (I know how to do this)
-
Passing that event ID to another part of the code in the form.
For example:
<%= form_for(@event_location) do |f| %>
<%= select("event_location", :event_id, events_names_ids_hash, { :include_blank => true }) %>
Then pass the selected event_id to another part of the same form
Amending Question
How do I capture the value of :event_id, PRIOR to submitting the form
See if you can use this. Exact code might now work you need to make small modification but this is the concept using java script.
<%= form_for(@event_location) do |f| %>
<%= select(“event_location”, :event_id, events_names_ids_hash, :onchange =>”javascriptFunction()”, { :include_blank => true }) %>