Auto_complete field problem?

<%= text_field_with_auto_complete :object,
:method,
:class=>“size”,
:onChange=>“load_details()” %>

in auto_complete text box if i press 1 then the list which has 1 as
first letter will be listed, if i select any one like 1632( for
example… ) ,then my javascript alert value is 1 (but it should be
1632).

how to solve this ?..