Ruby on Rails Thursday, December 30, 2010

djangst wrote in post #971568:
> Sounds like you want a button with the onclick event. If so, there's
> (apparently) a helper for that:
>
> http://apidock.com/rails/ActionView/Helpers/JavaScriptHelper/button_to_function

@djangst: that's what I've ended up doing. Upon reflection, I'm
wondering why I thought everything needed to be in a form. Works fine
without it, as in:

<%= hidden_field_tag("authenticity_token", form_authenticity_token, :id
=> "authenticity_token") %>
<%= text_field_tag("raw_address", nil, :size => 96, :id =>
"raw_address") %>
<%= select_tag("occupants", options_for_select([0.5, ... 8.0], 2.0)) %>
<%= submit_tag("search for address", :onclick => "geocodeAddress()") %>

--
Posted via http://www.ruby-forum.com/.

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment