Grary
2010-Mar-06 00:07 UTC
text_field value as a local variable in in-line template function
Hi, I''d like to conserve the sum total of several text fields on my form, even as I set them to blank upon a user link action. The following in-line snippet fails to store the value of my sum total field locally for eventual reassignment. (I am re-assigning it because the fields all have an observe_field nexus relating them, which complicates things.) <%= link_to_function "Itemize expenses" do |page| ... local_var = page[:operating_expense_admin_total].value page[:operating_expense_admin_other].value = "" page[:operating_expense_admin_advertising].value = "" page[:operating_expense_admin_management_fee].value = "" page[:operating_expense_admin_total].value = local_var end %> What is the proper way to extract values, store them locally and reassign them , per the attempt above? Thanks, Grar -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.