:after_update_element on text_field_with_auto_complete

I have a a basic prototype coded:

<%= text_field_with_auto_complete :student, :last_name, { :size => 15
:after_update_element => “alert(‘hello world’);” %>

class ScoresController < ApplicationController
auto_complete_for :student, :last_name

If I take out the :after_update_element option everything works as
advertised. However, with :after_update_element specified nothing
works. The ajax call to the server does not happen.

I am running Rails 1.1.2 on Mac 10.4.6 with Ruby 1.8.4. I am testing
this with Safari.

Does anyone know why this doesn’t work?

> <%= text_field_with_auto_complete :student, :last_name, { :size
=> 15 },
> :after_update_element => “alert(‘hello world’);” %>

This is the wrong syntax: a function is expected.
Try instead:
:after_update_element => “function(element,value){alert('You have
chosen: '+value)}”


oops, typo:

> Alan

should read :


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs