I have a selection list that I display for users. THere is a field that I allow users to type in information and using java script I take them to the closest match in the list using the substring feature.
I would like to do the same tthing using a wildcard. The field contains addresses that look like
1234 smith street
I would like to let the users enter the street name and find the entry. currently they have to know the address number.
below is the javascript i am using to take the user to the closest match.
any suggestions would be appreciated.
I would like to do the same tthing using a wildcard. The field contains addresses that look like
1234 smith street
I would like to let the users enter the street name and find the entry. currently they have to know the address number.
below is the javascript i am using to take the user to the closest match.
Code:
for (var i = 0; i < listlength; i++){
var lname = f.Names.options[i].text.substr(0,searchlength)
if (lname.toUpperCase() == str.toUpperCase()){
f.Names.focus();
var index_6 = i + 6;
if (index_6 >= listlength)
index_6 = listlength - 7;
if (index_6 < 0) break;
f.Names.options[index_6].selected = true;
f.Names.options[index_6].selected = false;
f.Names.options[i].selected = true;
f.name_search.focus();
break;
}
}
any suggestions would be appreciated.