Ruby on Rails and onchange
I got this code for a small calculator:
<%= form_tag calculators_path, :method => :post, :remote => true do %>
<%= text_field_tag :dat开发者_运维知识库a %> = <span id="sum"></div>
<% end %>
Can someone tell me how i can add the JS/Ajax onchange command to it, so the calculator automatically shows the result?
Sorry for that newbish question, im a total beginner.
:)
<%= form_tag calculators_path, :method => :post, :remote => true do %>
<%= text_field_tag :data, nil, :onkeyup => "this.form.sub.click()" %> = <span id="sum"></span>
<%= submit_tag "ok", :name => "sub" %>
<% end %>
精彩评论