Skip to content

Instantly share code, notes, and snippets.

@buddye
Created May 17, 2011 04:57
Show Gist options
  • Save buddye/975977 to your computer and use it in GitHub Desktop.
Save buddye/975977 to your computer and use it in GitHub Desktop.
Rails 3 Select form helper for onchange javascript event
<%= f.select :offer_type, { "Custom" => "offer", "Discount" => "discount", "Video" => "video" }, {}, :onchange => 'alert(this.options[this.selectedIndex].value);' %>
@dbaynes
Copy link

dbaynes commented Feb 21, 2012

Thanks for posting this. Incredible how difficult it is to find a clean, simple example like this from which to build upon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment