You could use the JS onblur to enable the check box.
<%= text_field_tag "text","field" :onblur =>
'check_text_field_for_text(this)' %>
then use a js function to check the text box for text and set the
checkbox accordingly.

On Mar 30, 10:19 am, Milo Thurston <[email protected]> wrote:
> This may seem like a bit of a silly question, but here's the reason:
>
> I have an app where a large number of options may need to be selected.
> Some are simply on/off with a checkbox but others have an additional
> text input field associated with them. This is OK if users read the
> instructions or they only select an on/off option, but sometimes for the
> options with additional text they simply type into the input field and
> neglect to tick the box as well. One way around this would be to
> re-write the code to remove the requirement for checkboxes on
> everything, but before doing that I would like to try using
> observe_field to tick the box if they start typing text in the field. Is
> that possible?
>
> So far I have something like this:
>
> <%= observe_field "text_input[#{parameter}]", :update =>
> "check_box[#{parameter}]", :parameters => 1, :frequency => 0.5 -%>
>
> This does not work. Is anyone able to suggest how this might be fixed?
> Thanks.
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to