This code simulates the fetching from a field in a field "keyword."
In the field it has "field_Entry," in the event "onKeyUp" places this code "SearchKeyword()." With this, when the user types the information in the field, it will automatically go to search the input of the data in the field "keyword."
This works only on Internet Explorer 4.0 or higher.
Code: function SearchKeyword(){
var doc = document.forms[0];
for(n=0; n <= doc.field_Entry.length - 1; n++){
if(doc.field_Entry.value == doc.field_Keyword.options[n].text.substring(0,doc.field_Entry.value.length)){
doc.field_Keyword.options[n].selected = true;
return true;
}
}
}
This was first published in January 2001