开发者

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 %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜