473,394 Members | 1,671 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,394 software developers and data experts.

Autocomplete in dropdown on ASP

I'm trying to put a drop-down box on an asp, which will containing a list of
names.

When a user starts typing a name that is in the list I want the text to
autocomplete

e.g. when the user types 'st' I'd like the text to autocomplete to steve or
stephen, depending on which is first in the list.

Can this be done??

Thanks in advance.
Jul 19 '05 #1
4 18683
> When a user starts typing a name that is in the list I want the text to
autocomplete


This is a client-side issue... I believe users can disable and enable this
within their browser settings. If there's a way to enable it from within
the page, then it's more than likely done with client-side javascript. I'd
look into a javascript group (comp.lang.javascript).
Jul 19 '05 #2
Abe Hills wrote:
I'm trying to put a drop-down box on an asp, which will containing a
list of names.

When a user starts typing a name that is in the list I want the text
to autocomplete

e.g. when the user types 'st' I'd like the text to autocomplete to
steve or stephen, depending on which is first in the list.

Can this be done??

Thanks in advance.


It can't be done via ASP, but it can with client-side code. Go to
http://www.thrasherwebdesign.com/ind...s&hp=links.asp and
download my dynamic listbox example. Even if you can't use this specific
code in your environment to accomplish your task, you may get some ideas
about how to do it from my code.

Please follow up on a client-side scripting newsgroup such as
microsoft.public.scripting.vbscript (or jscript) or one of the groups whose
name include "dhtml".

HTH,
Bob Barrows
Jul 19 '05 #3
On Wed, 16 Jul 2003 09:29:27 +0100, "Abe Hills"
<ab*******@blueyonder.co.uk> wrote:
I'm trying to put a drop-down box on an asp, which will containing a list of
names.

When a user starts typing a name that is in the list I want the text to
autocomplete

e.g. when the user types 'st' I'd like the text to autocomplete to steve or
stephen, depending on which is first in the list.

Can this be done??


Not in ASP, since it's client side, but I think Curt had some code on
darkfalz.com that did this. Hang on...

Dum de dum... deedle doo...

Yup. Here's a link:

http://www.darkfalz.com/VBNotes/post...spx?pstID=1086

Jeff
===================================
Jeff Cochran (IIS MVP)
jc*************@naplesgov.com - Munged of Course

I don't get much time to respond to direct email,
so posts here will have a better chance of getting
an answer. Besides, everyone benefits here.

Suggested resources:
http://www.iisfaq.com/
http://www.iisanswers.com/
http://www.iistoolshed.com/
http://securityadmin.info/
http://www.aspfaq.com/
http://support.microsoft.com/
====================================
Jul 19 '05 #4
Try this code:-

<html>
<head>

<Script language="javascript">
</Script>

<SCRIPT LANGUAGE=vbscript>
<!--
dim staffBuf

function SelectStaff
dim objSelect, i, iLen
SelectStaff = False
staffBuf = staffBuf & Chr(window.event.keyCode)
iLen = len(staffBuf)
set objSelect = document.form1.FilterStaff
for i = 0 to objSelect.Options.length - 1
if strcomp(left(objSelect.Options(i).Text, iLen), staffBuf, 1) = 0
then
objSelect.SelectedIndex = i
exit function
end if
next
staffBuf = ""
end function
-->
</script>

<body onload="form1.FilterStaff.focus()">
<form name="form1">
<select name="FilterStaff" onKeyPress="return SelectStaff();">
<option value="AAA">AAA</option>
<option value="ABB">ABB</option>
<option value="ABC">ABC</option>
<option value="BAA">BAA</option>
<option value="BBA">BBA</option>
<option value="BBC">BBC</option>
<option value="CAA">CAA</option>
<option value="CAB">CAB</option>
<option value="CBB">CBB</option>
</select>
</form>
</body>
</html>

Not sure why, but it doesn't seem to like it if you take out the first
Javascript section. Probably something to do with the return statement.

Dan
"Abe Hills" <ab*******@blueyonder.co.uk> wrote in message
news:22*****************@news-binary.blueyonder.co.uk...
I'm trying to put a drop-down box on an asp, which will containing a list of names.

When a user starts typing a name that is in the list I want the text to
autocomplete

e.g. when the user types 'st' I'd like the text to autocomplete to steve or stephen, depending on which is first in the list.

Can this be done??

Thanks in advance.

Jul 19 '05 #5

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

Similar topics

4
by: bc | last post by:
Hi, Is it possible to detect if the IE autocomplete function in a current context such as a textbox is activated (ie. dropdown with previously entered info is visible)? Problem: I use a script...
1
by: Kubus | last post by:
Please help, IE 6.0 seems to hava a problem with input form autocomplete dropdown positioning. The dropdown list with last entries which appears normally right below the field but when used within...
19
by: Bernie Yaeger | last post by:
Everyone misses the point on this - what we need is a combobox autocomplete that is a dropdownlist only. When in dropdown mode, you can enter text - making that autocomplete is trivial. But when...
0
by: venu | last post by:
Hi All I need some help from u guys. iam working on aspx page.in this page i have lot fields. text boxes and dropdown lists .. First filed should be a autocomplete filed. this text has onblur...
0
by: walterigo | last post by:
hello. I have been working all too hard trying to figure out how to get TextCtrlAutoComplete.py to start another word after it finishes the last word. I want it to start the autocomplete process...
5
by: Andrus | last post by:
I'm creating a database Winforms application using VCS Express 2005 I have some large lookup tables (may be up to 500000 records) which contains name and id and are stored in sql server. I...
1
by: wkerplunk | last post by:
Below is what I have build with several different languages. It works great but I need help, I am stuck. When you click on an item in the dropdown autocomplete div it does a mousedown function...
3
by: Therasa | last post by:
Dear All, I need the coding for AutoComplete feature in asp.net 1.1 dropdown(combo) box. Pls kindly help me to resolve this problem ASAP. Thanks in Advance. Regards, Therasa.
5
by: Pat | last post by:
Hi ASP Gurus, Please help me. Autocomplete works fine when the control does not have the focus when the page load. But when I put the focus on page load, then autocomplete does not work. I even...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...
0
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...
0
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...

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.