Question : Ruby nuby question about using form_for

I am trying to add a javascript "onsubmit" to a ruby on rails form (boss wrote the basic code then took off on vacation leaving me to finish something in a language I sooo don't know yet)

Here's the form tag generator, which works fine:

<% form_for(@inquiry) do |f| %>

I want to add an onsubmit.  I tried this:

<% form_for @inquiry, :onsubmit=>"validate_contact_form()" do |f| %>

...and there's no error, but no onsubmit attribute in the form, either.  I can't find another use of form_for that has the same format and also passes attributes....help?

Answer : Ruby nuby question about using form_for

Definitely a Rails zone question, please add and use for future questions!
Programming > Editors_IDEs > RubyOnRails
1:
2:
3:
4:
# use :html to send HTML options to be included 
# in the form tag's HTML (class, onsubmit, ...)
<% form_for @inquiry, 
  :html => {:onsubmit=>"validate_contact_form()"} do |f| %>
Open in New Window Select All
Random Solutions  
 
programming4us programming4us