sorry it's :
:with=>"'discount='+$('discount_code').value" .
You missed single quote in discount_code
Quy Doan wrote:
sorry it's : :with=>"'discount='+$('discount_code').value" . You missed single quote in discount_code
On Sep 19, 10:46�am, Vikas Gholap <rails-mailing-l...@andreas-s.net>
Thanks,
but how can i pass multiple parameters through :with option in link_to_remote
for example
=link_to_remote "Apply", :update => "plan_discount", :url => { :action => "discount_code"}, :with=>"'discount='+$('discount_code').value &'discount2='+$('discount_code2').value"
This is not working.
Where I'm doing wrong.
Hi Vikas
:with =>"'discount='+ escape($('discount_code').value) + '&discount2=' + escape($('discount_code2').value)"
Sijo
Hi
It should work.And what error you get? Also paste the code for textfields discount_code and tariff_plan_id
Sijo
Sijo Kg wrote:
H Vikas
%input{:type=>'radio', :name=>'tariff_plan_id', :value=>"#{plan['service']['name'].downcase}_#{plan['payment_term']['name'].downcase}"}
Give also give an id to this id=>'tariff_plan_id'
Sijo
Yes, by giving id to radio button it works.
But I have 5 radio_button with group "tariff_plan_id". If i give same id to all of them, there is problem of having same id for 5 radio buttons. and I think this is not correct.
- service['all_plans'].each do |plan| %input{:type=>'radio', :id => "tariff_plan_id_#{plan['service']['name'].downcase}_#{plan['payment_term']['name'].downcase}", :name=>'tariff_plan_id', :value=>"#{plan['service']['name'].downcase}_#{plan['payment_term']['name'].downcase}"}
here for each plan one radio button is generated. So another problem arises that how i know that which radio button is selected from "tariff_plan_id" group.
if consider 5 radio buttons are there (may be increased in feature) then I have to specify
tariff_plan_id_1 tariff_plan_id_2 tariff_plan_id_3 tariff_plan_id_4 tariff_plan_id_5
Thanks, Vikas