In a nutshell, my jQuery code in a rails form works in Firefox, but not
in Internet Explorer 7. Here is the form code with unnecessary details
stripped out:
<h1>New Discount Order</h1>
<div>
<%= error_messages_for :discount_order %>
<% vertical_form_for :discount_order, @discount_order, :url =>
discount_orders_path, :method => :post do |f| %>
<% f.radio_button_group :code_type, :label => 'Code Type', :id =>
'ctype' do %>
<%= f.radio_button :code_type, 'voucher', :label => 'Single-use
vouchers', :button_on_left => true %><br/>
<% if @who == 'partner' %>
<%= f.radio_button :code_type, 'affiliate', :label => 'Multi-use
affiliate', :button_on_left => true %>
<% end %>
<% end %>
<%= f.text_field :requested_codes, :size => 2, :label => "How Many
Codes", :help => 'Number of codes to generate. Only applies to
single-use codes.'%>
<% f.wide_content :id => 'has_expiration_date' do %>
<%= check_box_tag :has_expiration_dates, '1',
!...@discount_order.codes_expire_at.blank? %>Codes Expire?
<% end %>
<%= f.date_field :codes_expire_at, :label => 'Expiration Date',
:disabled => @discount_order.codes_expire_at.blank? %>
<%= f.submit 'Create', :cancel => {:controller => 'system', :action =>
'discounts'}%>
<% end %>
</div>
<script>
jQuery(function(){
jQuery('#has_expiration_date input').change(function(){
jQuery('#discount_order__codes_expire_at').attr('disabled',
!jQuery('#discount_order__codes_expire_at').attr('disabled'))
});
jQuery('#ctype').change(function(){
jQuery('#discount_order__requested_codes').attr('disabled',
!jQuery('#discount_order__requested_codes').attr('disabled'));
if (jQuery('#discount_order__code_type_affiliate:checked').val() ==
'affiliate') {
jQuery('#discount_order__requested_codes').val("")
}
})
})
</script>
Does anyone know a cross platform (Firefox and IE) solution to above?
Thanks for your time.
Bharat
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---