Forum: Ruby on Rails Specifying Javascript events for form fields

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Will B. (Guest)
on 2006-01-16 21:17
(Received via mailing list)
So forgive the stupid question, I'm a relative Rails newby.  I have a
form
that I would like to submit each time the user changes their selection
in
one of several select items (single selection only).

I've got this behavior working properly in the select_tag method, but I
also
have two other fields on the form - a month and a year.  The month and
year
tags are created using the select_month and select_year methods,
respectively.  I tried specifying an :onChange => 'submit()' option for
the
year and month methods, but it doesn't appear to do anything, even
though it
works with the select_tag methods.

Is there a way to do this?  I'd hate to have to throw out the Rails tag
creation helpers in order to write the raw HTML for the tags myself.

Any help would be greatly appreciated!

Thanks,
Will
This topic is locked and can not be replied to.