It looks like there are at least three problems with autocomplete in IE.
First, by default, apparently IE caches Ajax responses. That means if you
add a new item and then do a subsequent entry in the same browser session,
the new item will not appear in the autocomplete list because the list is
cached the first time it is generated. For example, if I enter "test1", as
soon as I type "te", IE caches the results of the query, which is empty at
that point. The next time I type "te", instead of getting "test1" in the
autocomplete list as expected, I get nothing, because the result of the "te"
query was cached by IE before "test1" was entered in the database. That's
why I initially thought the autocomplete wasn't working.
This problem can be resolved by using the jQuery .ajax() method and
specifying 'cache: false' in the settings instead of using the .get()
method. An alternative is to set jQuery.ajaxSetup({cache: false}), but that
will affect all Ajax calls made by the page, not just the autocomplete call.
Second, as I mentioned, as soon as I type two characters, the input box
loses focus, and I then have to click back in the box to enter each
additional character.
Third, once the autocomplete list appears, it disappears within a couple
seconds, regardless of what I do with the pointer.
I suppose the latter two problems are related to the onblur and onkeyup
Javascript, but I'm not sure exactly what's wrong or how to fix it. If
anyone has any suggestions or tips, I can play around with it some more.
Thanks.
Anthony
On Monday, June 13, 2011 4:46:30 PM UTC-4, Massimo Di Pierro wrote:
> Do you know why it does not work?
>
> On Jun 13, 10:28 am, Anthony <[email protected]> wrote:
> > I can confirm that the autocomplete widget does not work at all in IE 7,
> 8,
> > or 9 (at least not using the 'welcome' app). After I type two letters,
> the
> > input box loses focus (i.e., I cannot continue typing). I then click back
> in
> > the box, type another character, and it loses focus again -- I have to
> click
> > back in the box to enter each character. Also, as I enter characters, no
> > suggestions every appear (even though there are entries in the database
> that
> > match what I am typing). Same code works fine in Chrome. If anyone has
> any
> > suggestions, I'm happy to do some testing.
> >
> > Anthony
> >
> >
> >
> >
> >
> >
> >
> > On Monday, June 13, 2011 6:29:40 AM UTC-4, spyker wrote:
> > > I still have not find a solution to the problem of the autocomplete
> widget
> > > not working as it should on Internet Explorer.
> >
> > > The following code can illustrate my problem
> >
> > > db.define_table("toets",
> > > Field("veld1"))
> > > db.toets.veld1.widget = SQLFORM.widgets.autocomplete(
> > > request, db.toets.veld1, limitby=(0,20),
> > > min_length=2)
> >
> > > Fill the table with a few entries beginning with the same string in IE
> to
> > > see the problem.
> >
> > > I have now tested it with a new app using Web2py 1.96.4 (2011-06-07
> > > 21:08:15)* *to eliminate the problem that changes to my .css or
> javascript
> > > files could have caused the problem.
> >
> > > If anyone can get a solution I will really appreciate it.
> >
> > > Regards
> > > Johann
> > > --
> > > May grace and peace be yours in abundance through the full knowledge
> of
> > > God and of Jesus our Lord! His divine power has given us everything we
> need
> > > for life and godliness through the full knowledge of the one who called
> us
> > > by his own glory and excellence.
> > > 2 Pet. 1:2b,3a