473,657 Members | 2,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disable auto-search in listbox control

Ben
I've got an asp page that populates a listbox with info from a db.

The list box ends up being pretty big, so I want to be able to search
it effectively. I like the method wherein the user types the letters
of the word they are looking for from within the listbox and the
control automatically scrolls to the item matching the chars they have
typed thus far.

Example:

If the listbox were to contain states Alabama, Alaska, and Louisiana,
when the user clicked in the listbox and typed "Ala" the box would
scroll to Alabama, and when they typed an additional 's', so the typed
string was "Alas", the box would scroll to Alaska.

Problem:

I've got javascript that does this very well, but the listbox control
default search behavior overrides my javascript. So, the javascript
will correctly index to Alaska when "Alas" is typed, but when the
javascript function is done running, the list moves down to Louisiana,
because the asp control thinks that by typing 'l' the user wants to
move to the first item in the box beginning with an 'l'.

Question:

Can I disable the default search behavior in the control? If so, how?
If not, does anyone have any thoughts on how else I might get around
this problem?

Thanks and regards,

Ben
Jul 19 '05 #1
2 2330
Ben wrote:
I've got an asp page that populates a listbox with info from a db.

The list box ends up being pretty big, so I want to be able to search
it effectively. I like the method wherein the user types the letters
of the word they are looking for from within the listbox and the
control automatically scrolls to the item matching the chars they have
typed thus far.

Example:

If the listbox were to contain states Alabama, Alaska, and Louisiana,
when the user clicked in the listbox and typed "Ala" the box would
scroll to Alabama, and when they typed an additional 's', so the typed
string was "Alas", the box would scroll to Alaska.

Problem:

I've got javascript that does this very well, but the listbox control
default search behavior overrides my javascript. So, the javascript
will correctly index to Alaska when "Alas" is typed, but when the
javascript function is done running, the list moves down to Louisiana,
because the asp control thinks that by typing 'l' the user wants to
move to the first item in the box beginning with an 'l'.

Question:

Can I disable the default search behavior in the control? If so, how?
If not, does anyone have any thoughts on how else I might get around
this problem?


This is not an asp issue (you would have the same problem if you put the
control on a non-asp page would you not?). Please follow up in a client-side
scripting newsgroup such as one of the ones with "dhtml" and "scripting" in
their names, or the m.p.scripting.j script newsgroup.

I have created a demo illustrating one way to do this at
http://www.thrasherwebdesign.com/ind...asp&c=&a=clear

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #2
Ben
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message news:<#d******* *******@TK2MSFT NGP09.phx.gbl>. ..
Ben wrote:
I've got an asp page that populates a listbox with info from a db.

The list box ends up being pretty big, so I want to be able to search
it effectively. I like the method wherein the user types the letters
of the word they are looking for from within the listbox and the
control automatically scrolls to the item matching the chars they have
typed thus far.

Example:

If the listbox were to contain states Alabama, Alaska, and Louisiana,
when the user clicked in the listbox and typed "Ala" the box would
scroll to Alabama, and when they typed an additional 's', so the typed
string was "Alas", the box would scroll to Alaska.

Problem:

I've got javascript that does this very well, but the listbox control
default search behavior overrides my javascript. So, the javascript
will correctly index to Alaska when "Alas" is typed, but when the
javascript function is done running, the list moves down to Louisiana,
because the asp control thinks that by typing 'l' the user wants to
move to the first item in the box beginning with an 'l'.

Question:

Can I disable the default search behavior in the control? If so, how?
If not, does anyone have any thoughts on how else I might get around
this problem?


This is not an asp issue (you would have the same problem if you put the
control on a non-asp page would you not?). Please follow up in a client-side
scripting newsgroup such as one of the ones with "dhtml" and "scripting" in
their names, or the m.p.scripting.j script newsgroup.

I have created a demo illustrating one way to do this at
http://www.thrasherwebdesign.com/ind...asp&c=&a=clear

Bob Barrows


Thanks for the pointer as well as the example. I'll try some other groups.

Regards,

Ben
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3414
by: Barry | last post by:
Hello, I've recently noticed that someone can simply type in the URL to my javaScript, from my HTML source code, to the explorer location bar and an auto-save dialog pops up to let them save it ! My clients want to keep their paid-for code proprietary. How do I prevent this from occuring ? The javaScripts are embedded in my HTML in the following manner:
0
1847
by: rawCoder | last post by:
If an item is added in a grid, then the grid scrolls automatically either to bring the selected or the last entered item in focus. Is there a way to disable this scrolling. Means, If I am looking at item number 500 and the item number 100 is selected and an item is added at the top. Then grid doesnt scroll anywhere and item number 500 keeps in view. Is it possible ?
2
2001
by: John Holmes | last post by:
I saw a similar post that went unanswered about a month ago. I am annoyed by the auto-formatting that occurs when creating my form. I'll make changes to the code (HTML tab) and then view them in Design mode and when I go back to the HTML mode the code I just typed in has been reformatted. It doesn't always do it the same either. I usually don't capitalize tag names and it will auto-capitalize the ending tags sometimes. I've gone through...
2
1550
by: hb | last post by:
Hi, The auto-formatting of HTML code in Visual Studio.Net 2003 is very annoying! I already unchecked the 2 checkboxes in "Apply Automatic Formatting" section located at: Tools-->Options-->Text Editor-->HTML/XML-->Format But the VS still does the HTML code auto-formatting. The most notable is the auto-conversion of "&raquo;" to ">>" and the likes which make some pages look ugly on other browsers.
24
4855
by: Agnes | last post by:
I need to disable the exit button in the form . However, the min. and max. button need to keep it How ? Thanks a lot From Agnes
1
1300
by: Julien Grossiord | last post by:
Hello, As I do not need it, I would like to disable ViewState on my server but even if I use <pages enableViewState="false"> in web.config or <%@ Page EnableViewState="false" .... %> in my pages, I still have a hidden field __VIEWSTATE in the form. Do you know how I could disable it ? Best regards, Julien.
2
565
by: Larry | last post by:
Is there a way to disable all the controls the instant any auto-postback controls are changed (resulting in a postback that takes a couple seconds), so that the user can't continue changing other controls while the postback to the server is running? The reason this is necessary is because the user can be fooled into not knowing that the browser has posted-back to the server (he doesn't see the little blue progress bar at the bottom of...
2
1341
by: Joe Cool | last post by:
When I put a disk in my dvd drive, most of the time windows askes me how I want to process the files on the disk. Sometimes, it will automatically open a browser window showing the contents of the disk. I have an application I wrote in VB2005 that puts together pieces of a larger file that had been burned to two or more disks. When it finishes the file on one disk, it opens the dvd tray and prompts for the next disk. When I put the next...
2
5618
by: khng | last post by:
How to disable the copy/drag event for some selected textfield as I want the user to key in instead of copy or drag the required information. For IE, I done it with the onPaste and onDragEnter Event, but it don't work on Other Browser, so I need your helping hand
0
2154
by: =?Utf-8?B?Y29kZW11dHQ=?= | last post by:
I've got a problem where my HTTP WCF messages are not going where I want them to go because my company has tightened its proxy restrictions. Basically the AUTO-DETECTION of a proxy that has been set up for the browser to hinder certain website access is causing .NET / WCF to use the proxy when sending messages bound for a different web service (not the proxy). I cannot just turn off the proxy in the LAN settings. What I want to do is...
0
8837
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.