i have 2 <div> blocks, each which have a form select box. I have an
observe_field watching the first dropdown, and populating data from the
second one when the first changes. The issue is when i change the first
dropdown, the second form element doesnt get submitted any more after
clicking on the submit button, and doesnt appear in the "@params" hash
any longer. Any idea why this would happen? The data all looks correct
in the form, even after changing dropdown options, just the field
(os_versions) seems to "disappear" after submitting the whole form,
and
only when changing the OS select box.
here is my snippet:
<div align="left" class="addnode_item">
<select name="os" id="os" >
<% @systems.each do |s| %>
<option value="<%= s.id %>"> <%= s.osname
%> </option>
<% end %>
</select>
</div>
<%= observe_field "os", :url => {:action =>
"get_os_versions"},
:update => "os_versions", :with => "''os=''
+ escape(value)" ,:loading =>
"os_versions.innerHTML=''<font color=green> Please wait while
finding OS
versions....</font><br><br>''"%>
<div align="left" class="addnode_item"
id="os_versions">
<% if @os_id %>
<%= render_component(:action => "get_os_versions",
:params => {
"os" => "#{@os_id}" }) %>
<% end %>
</div>
thanks
adam