I'm using simple_form with Rails 3.2.5. I have a form that looks like this:
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => {:class => 'form-vertical' }, :html => {:name => "new_user"}) do |f| %>
<%= f.error_notification %>
<%= f.input :field_one,
:placeholder => '30000',
:autofocus => true,
:required => true,
:html => {:onFocus => 'startCalc();'},
:html => {:onBlur => 'stopCalc();'} %>
# More form fields
<% end %>
I'm trying to call a Javascript driven calculation when a user enters a number in the form field, but the Javascript isn't showing up in the outputted HMTL:
<input autofocus="autofocus" class="numeric decimal required" id="field_one" name="user[field_one]" placeholder="30000" step="any" type="number" />
Does anyone know how to get simple_form to add these bits of Javascript?
Thanks!
Greg