473,770 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 18706
> 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.java script).
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.publi c.scripting.vbs cript (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*******@blue yonder.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="javas cript">
</Script>

<SCRIPT LANGUAGE=vbscri pt>
<!--
dim staffBuf

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

<body onload="form1.F ilterStaff.focu s()">
<form name="form1">
<select name="FilterSta ff" onKeyPress="ret urn 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*******@blue yonder.co.uk> wrote in message
news:22******** *********@news-binary.blueyond er.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
5256
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 as a basis for binding <enter> in textbox to a button, BUT <enter> in the dropdown autocomplete generated by IE also triggers this event. The script is available below (in .NET context but the idea should
1
2423
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 an IFRAME it is offset far down from input field - seems the dropdown is moved down exactly same amount as IFRAME offset from the top of the main document. Simple example: <form method="get"> <input type="text" name="Name" value="">
19
18351
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 you look at combobox controls from years ago, they would autocomplete in dropdownlist mode. And if you look at intellisense, this is exactly what happens, so obviously the .net framework can do it. Any help would be much appreciated. Bernie...
0
1788
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 event also based on this text box when onblur event is fired that time other fields will populate. This time this textbox should be a auto-complete . this is not happend in my page. this page has lot of onblur event's also.
0
2073
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 all over again after it finishes the autocomplete process. I have striped down the program to a smaller version than the orginal. it now works in a multiline wx.textctrl box. belive that the program only needs one or two lines to complete the...
5
12662
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 need to create single line combobox style control which: 1. Allows to type first characters in name 2. Auto-completes entered data by using first match 3. Allows to open picklist based by entered data and select name
1
3854
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 and send the item number to the xmlHttp and works awesome. Now I need to add an apply button next to it. so they can type in the complete number then hit apply and it does the same function. I cant get it to work with the script I have. The image...
3
4530
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
3367
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 tried javascript pageload code, but with no success. <script language ="javascript" type ="text/javascript" > function focusIt() { //alert('test'); var mytext =
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10101
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
10038
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
9906
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...
1
7456
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...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4007
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
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
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.