I have a form, html elements get added to it via ajax calls, and I want to be able to pass the values of the added html elements to the form submit. Details:
I have a simple form_for:
<%= form_tag(:controller => "operations", :action => "new") do %>
<%= select_tag "operation", options_for_select(%w{a s m d} )%>
depending on a user’s action on the select tag, I do
$.get(url, params,function(response){
}, 'script')});
The ajax call returns an html radio_button_tag i.e. the url called has something like:
<div class="modifer">
<%= radio_button_tag elid, 'no' %>
</div>
The user can now select the radio button, and I want to pass this value as part of the form submit. I really don’t understand how to pass the value of the radio_button_tag (elid) as part of the form submit.
Would appreciate some clarification on this
Are you inserting the .modifier div into the form? If so, it will be submitted with the form.