19 Jul 21:44
text_field_with_auto_complete - Trigger on NonSelecting
From: Sandeep Gudibanda <rails-mailing-list@...>
Subject: text_field_with_auto_complete - Trigger on NonSelecting
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-19 19:46:03 GMT
Subject: text_field_with_auto_complete - Trigger on NonSelecting
Newsgroups: gmane.comp.lang.ruby.rails
Date: 2008-07-19 19:46:03 GMT
Hi, I am using text_field_with_auto_complete on a field. I update a part of my page if user chooses any particular option listed by auto_complete list. To do this I call and remote_function with :after_update_element. But I also wanna update a part of my page if user doesn't select anything from the autocomplete list. For EX: I want to Bring it to notice of the user that the "Name" that he has not entered is not in our database. The div like below should be higlighted <div id ="error_box" class="error_box" style="display:none"> <span class="showtext bold"> Hospital entered was not found. Please enter the details here: </span> </div> So what I need to do is : When control moves out of the field on which auto_complete is enacted, and when user doesn't select any option listed by auto_complete, I want to trigger a different action. I tried to simulate this using text_field_with_auto_complete along with observe_field :on => :change. It didn't help, as onChange gets triggered on both cases: User selecting one option from the list and User entering a new Name. How can I solve this? Please suggest.(Continue reading)
RSS Feed