%= form_for @subscription, :html => {:class => 'form-horizontal'} do |f| %>
<%= f.hidden_field :bundle_id %>
<%= f.hidden_field :account_id %>
<%= f.hidden_field :product_category %>
<% if @subscription.product_category == 'ADD_ON' %>
<%= hidden_field_tag :base_product_name, @base_product_name %>
<% elsif @subscription.product_category == 'BASE' %>
<% end %>
<% end %>
<%= javascript_tag do %>
function onTypeChange() {
var value = $("input[type=radio]:checked").val();
if (value == "IMM") {
$("#form_requested_date").hide();
} else if (value == "DATE") {
$("#form_requested_date").show();
}
}
$(document).ready(function() {
onTypeChange();
$( "input[type=radio]").on("click", function() {
onTypeChange();
});
});
<% end %>