There are a couple of ones out there. Deadbeef seems to be quite good but is only supported by IE:
http://www.deadbeef.com/index.php/2005/08/04/title
What i use sometimes is this code as you can pass the value over and not just the name as in the one above:
PHP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Test page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript">
//Autocomplete textfield
function matchFieldSelect (field, select, value) {
var property = value ? 'value' : 'text';
var found = false;
for (var i = 0; i < select.options.length; i++)
if ((found = select.options[i][property].indexOf(field.value) ==
0))
break;
if (found)
select.selectedIndex = i;
else
select.selectedIndex = -1;
if (field.createTextRange) {
var cursorKeys ="8;46;37;38;39;40;33;34;35;36;45;"
if (cursorKeys.indexOf(event.keyCode+";") == -1) {
var r1 = field.createTextRange()
var oldValue = r1.text;
var newValue = found ? select.options[i][property] : oldValue;
if (newValue != field.value) {
field.value = newValue
var rNew = field.createTextRange()
rNew.moveStart('character', oldValue.length)
rNew.select()
}
}
}
}
</script>
</head>
<body>
<form>
<input type="text" name="a" onkeyup="matchFieldSelect(this, this.form.b)" />
<select name="b" size="1">
<option value="1">aa</option>
<option value="2">bb</option>
<option value="3">cc</option>
<option value="4">dd</option>
</select>
</form>
</body>
</html>
Bookmarks