Topic: How-to add javascript to formHelpers

For example,

I want to add:

onClick='this.focus();this.select();'

to <%= text_area 'my_variable', 'my_attribute' %>

How do I do that?  There should be something simple like a :javascript option.  E.g.

<%= text_area 'my_variable', 'my_attribute', :javascript => "onClick='this.focus();this.select();'" %>

Shouldn't there?

Thanks in advance!! smile

David smile

Re: How-to add javascript to formHelpers

Try this:

<%= text_area 'my_variable', 'my_attribute', :onclick => '...' %>

Railscasts - Free Ruby on Rails Screencasts