Good day.
I have spent almost 2 days on this issue.
I have asked everyone from my Rails expert to my Javasript expert and we can
not for the life of us figure out the issue with this one form element.
I have a form which contains several readonly/disabled (firefox/ie) form
elements.
ALL elements in the form are updated correctly EXCEPT this one form element.
The form element in the view looks as the following:
<input type="text" id="total_commission_<%= @product.id
%>"
name="total_commission_<%= @product.id %>"
value="<%number_to_currency(po_detail.commission, { :precision => 4
}) rescue nil %>"
disabled="true" readonly="readonly" style="width:
50%"/>
The RJS template code is as follows:
page <<
"(''total_commission_#{@product_id}'').value=''"
+
number_to_currency(@new_total_commission, { :precision => 4 }).to_s +
"'';"
The controller code is as follows in the update_totals method which is
called via the observe_field :
if @comm_type == "L"
@new_total_commission = @new_total_sell.to_f * @converted_rate.to_f
else
@new_total_commission = @new_total_weight.to_f * @converted_rate.to_f
end
Outputting debug to the log file shows that the @new_total_commission is
being set correctly.
The debug information in the browser window for the RJS "trick"
produces the
following:
(''total_commission_3407'').value=''$210.0000'';
As I have stated, there are SEVERAL of these readonly/disabled fields and
ALL of them are updated EXCEPT this one form field.
I have yet to understand what could be causing this one field to be left out
of the update party.
If anyone has any type of advice to offer, I am open to anything/everything
that might work.
Cheers,
--
~d
"Right is right, even if everyone is against it, and wrong is wrong, even
if
everyone is for it." --William Penn
www.razorpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails/attachments/20060919/cea918a6/attachment.html