View Full Version : Auto Complete Like Text Box
KrazyKid
07-09-2002, 05:48 PM
Has there been or is there any method or function already created that will based on the entry event cause a textbox to behave such as the auto complete feature in IE?
e.g. Can you make a text box that behaves like a drop-down combo list box?
Any/All suggestions are welcomed!
Thanks!
Quiet Storm
07-09-2002, 06:09 PM
Found this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie50/html/ACoff.asp
KrazyKid
07-09-2002, 06:35 PM
QuietStorm, thanks for the link...
I want to "enable" a similar feature but not the autocomplete in IE.
The feature would provide a set of values to allow the end user to choose from or be able to type in their own value.
adios
07-10-2002, 03:17 AM
You can pretty much re-engineer form controls into behaviors of your choosing; MSIE 'autocomplete', obviously, involves a pretty sophisticated level of data manipulation and would require a lot of work. If you're just looking for something to impress/spoil your users, here's a easy sample:
<html>
<head>
<title>untitled</title>
<style type="text/css">
table {
font: 200 14px "times new roman";
color: orange;
margin: 0px;
padding: 0px;
border:3px darkgreen double;
background: black;
}
input {
width: 100px;
border: 1px darkred solid;
background: ivory;
}
select {
background: orange;
}
</style>
</style>
</head>
<body>
<form>
<table><tr><td>My website is</td><td>
<input name="t1" type="text"
onfocus="choices.style.visibility='visible'"
onkeypress="choices.style.visibility='hidden'"></td></tr><td></td><td>
<select name="choices" style="visibility:hidden;"
onchange="if(this.selectedIndex)t1.value=this[this.selectedIndex].value;
this.selectedIndex=0;
this.style.visibility='hidden'">
<option selected="selected">choose</option>
<option value="awful">Awful</option>
<option value="bad">Bad</option>
<option value="barely tolerable">Barely Tolerable</option>
<option value="disturbing">Disturbing</option>
<option value="steve">Steve</option>
</select>
</td></tr></table>
</form>
</body>
</html>
KrazyKid
07-10-2002, 12:52 PM
Thanks Adios that is really slick!!
I added in "multiple" to the select tag and it behaves exactly as I wanted!!
I appreciate you taking the time to code it out!
Thanks for sharing all your knowledge! :thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.