Xavier Noria
12/7/2007 10:05:00 PM
On Dec 7, 2007, at 9:25 PM, Neha Chopra wrote:
> But i cant use the tag directly.
> I want to use it this way
> <input type="text" id="criteria[<%=count%>][data_autocomplete]"
> name="criteria[<%=count%>][data_autocomplete]" size="60"
> autocomplete="on"/>
>
> and i dont know what javascript to pass so that observer gets fired
> and
> all.
This is a starting point, where each component is more or less self-
explanatory:
return <<-HTML
#{auto_complete_stylesheet unless
completion_options[:skip_style]}
#{text_field_tag tf_name, tf_value, tag_options}
#{content_tag("div", "", :id =>
"#{tf_id}_auto_complete", :class => "auto_complete")}
#{auto_complete_field tf_id, completion_options}
HTML
You create custom HTML elements, and after that delegate in
auto_complete_field.
-- fxn