I'm looking for a script that lets me:
1. Write for ex. "a" in a input-form and then
2. let me see all options in a select-form that starts with letter "a". Without reloading the page.
Anyone who's familiar with this type of script?
//Uffe
OK, I got your point with that script. For the moment I'm working with a script that I found on the net. If I can get this script to search from the sixth column then my problem is solved. Thanks anyway Dave, maybe you have a solution for this one instead.
<html>
<HEAD>
<script language="JavaScript">
function Find_Term(search,field)
{
var pattern
if (search.value == "")
{
field.options.selectedIndex = -1;
return;
}
//Use "i" to make search not case-sensitive
pattern = new RegExp("^" + search.value, "i");
for(var x=0; x < field.options.length; x++)
{
if (pattern.test(field.options[x].text) == true)
{
field.options[x].selected = true
break;
}
}
}
//This is the one that I'm trying to implement to the script above
//var char=xxxxx.charAt(6);
</script>
</HEAD>
<BODY>
<FORM METHOD="POST" NAME="frmMemo">
<input type="text" name='txtSearch' onkeyup='Find_Term(this, this.form.description);'>
<SELECT NAME="description" size='5'>
<option>1000 Administratör</option>
<option>1001 Thomas Ohlson</option>
<option>1002 Johan Fernholm</option>
<option>1003 Ulf Bengtsson</option>
<option>1004</option>
<option>1005</option>
<option>1006</option>
<option>1007</option>
<option>1008</option>
<option>1009</option>
<option>1010</option>
</SELECT>
</FORM>
</body>
</html>