473,378 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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 2306
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.jscript 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******@NOyahoo.SPAMcom> wrote in message news:<#d**************@TK2MSFTNGP09.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.jscript 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
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...
0
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...
2
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...
2
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...
24
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
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...
2
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...
2
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...
2
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.