I have two options for select. I am trying to get it to where if the user selects "Case Manager" for option for select #1, then option for select #2 appears (it is currently hidden from the user).
Here is my code:
Haml:
= form_tag app_configurations_path, :method=> 'put' do |f|
-@all_configurations.each do |config|
=hidden_field_tag "config_ids[]", config.id
%label= t('workflow.duplicate_claim_manager')
= select_tag('duplicate_claim[case_manager]', options_for_select(@case_managers_drop_down, config.configuration_value),name: "config[#{config.id}]", :include_blank => true)
%label.hidden(for="duplicate_claim_manager_secondary")
= hidden_field('duplicate_claim_manager_secondary', options_for_select(@case_managers_drop_down, config.configuration_value),name: "config[#{config.id}]", :include_blank => true)
The Haml appears to be correct, but I can't get the Javascript to correctly unhide option for select #2. Any ideas?
if ($("#duplicate_claim_case_manager :selected").text() == "Case Manager") {
$("#duplicate_claim_manager_secondary).setAttribute(type => text)
}