views:

26

answers:

0

Hi, when trying to do a search box in a Rails project, search is based on input id numbers, I am using a text_field_tag with a observe_field. But the strange thing is that the the search box wouldn't trigger a event unless user pressed enter. I would expected that it would do incremental search, react when user input a new character (numbers only in my case).

I've also tried using the observe_field without ":frequency" options, but same. Also, I've use pretty much the same code for search in the same partial page, but it act differently and working as expected (react to each input char from user). Another Rails magic?

= text_field_tag("query", @current_query, :size => 25)
= observe_field("query", :frequency => 0.75, :function => "search(value, '#{controller}')")