We do something like this in our user admin.  We've got about 1000 users.

First, create a form with the select box and a text box above it:

<form name="myForm" method="post" action=""> <input type="text" name="sSearchName" > document.forms.myForm.optUsers );" value="" autocomplete="off"><br>
<select size="20" name="optUsers" multiple="multiple">
    <option value="#user_id#">#user_name#</option>   
    ... loop through user lists
</select>

Then create the _javascript_:

<script language="_javascript_">
function ChangeDisplay(iUser) {
//document.all.frmLookup.src =""> "administration/userlookup.cfm?iSelectedUserID=" + iUser;
frames['frmLookup'].location.href =""> "administration/userlookup.cfm?iSelectedUserID=" + iUser;
return;
}

function vHighLight(obj, objSelect) {
var iLength = obj.value.length;
for (i=0; i<=iLength; i++) {
var sMatch =
objSelect[i].text.substr(0,iLength).toLowerCase();
var sName = obj.value.toLowerCase();
if (sMatch == sName) {
objSelect[i].selected = true;
userid = objSelect[i].value;
break;
}
}
}
</script>

You'll need to put in some more code to handle the form submit, but that
should get you started...I hope.

-----Original Message-----
From: Nathan R. Jessop [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 8:41 AM
To: CF-Talk
Subject: re: Huge dropdown list of names...type in name as well as selecting
it???

Hi,

I have a <select> lists thats used when logging into my application and it
can be quite large. Its a list of user name which gets updated on the fly as
accounts are created.

Currently when I logged in there was a huge list of users  had to select
from. Is there any way that I could allow users to type in their user name
as well as select it. The idea would be like how the
Outlook address book works. I type my name in and it scrolls down until it
finds it.

Thoughts?

---------------------------------------------------
Colonel Nathan R. Jessop
Commanding Officer
Marine Ground Forces
Guatanamo Bay, Cuba
---------------------------------------------------
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to