My sugestion
<input type="text" class="autoComplete" id="text1" value=""/>
<div id="choice1" class="autocomplete"></div>
<input type="text" class="autoComplete" id="text2" value=""/>
<div id="choice2" class="autocomplete"></div>
<input type="text" class="autoComplete" id="text3" value=""/>
<div id="choice3" class="autocomplete"></div>

And Javascript Part

var AutoCompleters = new Array();
AutoCompleters[AutoCompleters.length]=new Ajax.Autocompleter("text1",
"choice1", "/url/on/server", {});
AutoCompleters[AutoCompleters.length]=new Ajax.Autocompleter("text2",
"choice2", "/url/on/server", {});
...
and after that you can create function
function disable()
{
 AutoCompleter.each(function(item)
 {
     Event.stopObserving(item.element, "keypress",
item.onKeyPress.bindAsEventListener(this));
 });
}

function enable()
{
 AutoCompleter.each(function(item)
 {
     Event.stopObserving(item.element, "keypress",
item.onKeyPress.bindAsEventListener(item));
 });
}

Something like that i think. I write from my head, so i don't know if it works.


2006/11/30, mobrien118 <[EMAIL PROTECTED]>:

I'm sure there is an easy way to do this, but it is one of those things
that is incredibly difficult to search for.

How can I disable an 'Ajax.Autocompleter' element from working 'on the
fly'? I have a page where I'm using two (I know it's crazy)
Ajax.Autocompleter elements and once one of them has got a result I
want the other field to just behave as a normal text input.

There may even be a defined method to do this but I don't know what it
is.

Any help?

Thanks in advance,

--mobrien118


>



--
Pozdrawiam
Arkadiusz M ynarczyk

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to