# Text\_field\_with\_auto\_complete

**URL:** <https://www.ruby-forum.com/t/text-field-with-auto-complete/148716>\
**Category:** Rails\
**Created:** [September 16, 2008, 3:37pm UTC](https://www.ruby-forum.com/t/text-field-with-auto-complete/148716 "2008-09-16T15:37:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![palani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed655f/32.png) [@palani](https://www.ruby-forum.com/u/palani)\
**Post date:** [September 16, 2008, 3:37pm UTC](https://www.ruby-forum.com/t/text-field-with-auto-complete/148716/1 "2008-09-16T15:37:59Z")

</div>

Hi,  
Any one please help to me solve the problem in  
text\_field\_with\_auto\_complete.

I want to call the auto\_complete AJAX function only after i enter 4  
characters.  
To do this i have included the “min\_chars” option.

My code is

\<%= text\_field\_with\_auto\_complete :detail, :title, {:min\_chars =\> 4} %\>

But this is not working .

Am i doing any mistakes? Pls. help me!!!

---

<div class="post-metadata">

**Author:** ![palani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed655f/32.png) [@palani](https://www.ruby-forum.com/u/palani)\
**Post date:** [September 16, 2008, 3:48pm UTC](https://www.ruby-forum.com/t/text-field-with-auto-complete/148716/2 "2008-09-16T15:48:39Z")

</div>

On Tue, Sep 16, 2008 at 3:37 PM, Palani K.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> \<%= text\_field\_with\_auto\_complete :detail, :title, {:min\_chars =\> 4} %\>

The signature of the helper is

text\_field\_with\_auto\_complete(object, method, tag\_options = {},  
completion\_options = {})

So you need to put an explicit empty tag\_options this way:

\<%# untested %\>  
\<%= text\_field\_with\_auto\_complete :detail, :title, {}, :min\_chars =\> 4  
%\>

---

<div class="post-metadata">

**Author:** ![palani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed655f/32.png) [@palani](https://www.ruby-forum.com/u/palani)\
**Post date:** [September 16, 2008, 3:59pm UTC](https://www.ruby-forum.com/t/text-field-with-auto-complete/148716/3 "2008-09-16T15:59:59Z")

</div>

Xavier N. wrote:

> On Tue, Sep 16, 2008 at 3:37 PM, Palani K.  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > \<%= text\_field\_with\_auto\_complete :detail, :title, {:min\_chars =\> 4} %\>
> 
> The signature of the helper is
> 
> text\_field\_with\_auto\_complete(object, method, tag\_options = {},  
> completion\_options = {})
> 
> So you need to put an explicit empty tag\_options this way:
> 
> \<%# untested %\>  
> \<%= text\_field\_with\_auto\_complete :detail, :title, {}, :min\_chars =\> 4  
> %\>

Hi Xavier N.,  
It works for me .Thank you so much man thank you so much…  
great work done by you…
