Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
| Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 16th, 2005, 12:45 PM
Registered User
 
Join Date: Jun 2005
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Autosuggest Textbox Issue

If you type a sequence of letters too quickly ("mi"), the dropdown narrows to a single item and the textbox is completed with the first item in the list that matches that criteria ("Michigan"). Do you think there might be a way to get around that?

 
Old June 20th, 2005, 11:15 AM
nzakas's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default

This textbox isn't designed for "industrial strength," so issues like this will occur. If you want to try to fix it, you'd need to use a timeout such as:

    this.textbox.onkeyup = function (oEvent) {

        //check for the proper location of the event object
        if (!oEvent) {
            oEvent = window.event;
        }

        //call the handleKeyUp() method with the event object

        clearTimeout(this.timeoutID);
        this.timeoutID = window.setTimeout(function () { oThis.handleKeyUp(oEvent);},250);

    };

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/
 
Old July 12th, 2005, 01:47 PM
Registered User
 
Join Date: Jun 2005
Location: , , .
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How can I return focus to the textbox after the Enter key is pressed?

 
Old August 3rd, 2005, 02:25 PM
Registered User
 
Join Date: Aug 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried the code modification the author posted above, but it disabled the typehead and dropdown - although you could still type in the textbox, and no js error was produced, at least in Firefox.

Has anyone had success with this modification? If so, I'd appreciate knowing exactly what you did. Thanks.




Similar Threads
Thread Thread Starter Forum Replies Last Post
autosuggest using ajax rajesh_css Ajax 1 October 29th, 2008 03:09 AM
AutoSuggest typeAhead issue Dinesh Gupta Javascript 14 October 29th, 2008 02:19 AM
AutoSuggest and Links gt96 BOOK: Professional Ajax ISBN: 978-0-471-77778-6 1 July 4th, 2006 04:58 PM
Converting AutoSuggest textbox to .NET UserControl gulbaek BOOK: Professional Ajax ISBN: 978-0-471-77778-6 7 July 3rd, 2006 10:36 AM
Autosuggest Textbox by Nicholas Zakas smay Javascript 5 January 13th, 2006 07:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.