Resorting a drop-down list dynamically from string input in a separate text field

Results 1 to 3 of 3

Thread: Resorting a drop-down list dynamically from string input in a separate text field

  1. #1
    Bill Anthony Guest

    Default Resorting a drop-down list dynamically from string input in a separate text field

    Fellow developers:<BR><BR>Our development team needs to load an employee database of over 3000 records so that a user can arrive at an ASP page (which loads the records by employee name in a drop-down list), select an employee, and continue.<BR><BR>My issue is that I would like to provide a single line text field, whereby, the user can begin to type the employee&#039s last name, and while doing so, the drop-down list automatically resorts based on each keypress. In other words, as the user begins to type "SMITH"; the drop-down list would only show employees with last name starting with "S" as the user types "S"; then "SM" as the user types "M"; and so on. Yet, I would also like to perform reverse functionality, whereby, removing a character from the textbox will resort the drop-down list in accordance with each backspace.<BR><BR>This is probably a JavaScript function, and thus, should be brought up in a Javascript forum, but I don&#039t know of any JavaScript forums to pose the question; nor am I a JavaScript developer. If anyone has any detailed information on how I could accomplish this either in JavaScript, VBScript, or ASP technology, I would be most grateful. Thanks for your time.<BR><BR>Regards,<BR><BR>Bill Anthony

  2. #2
    Chris Willey Guest

    Default RE: Resorting a drop-down list dynamically from string input in a separate text field

    Handling keypresses in this fashion is a job for Java or ActiveX. Javascript, VBScript, ASP can&#039t do it.

  3. #3
    Join Date
    Dec 1969
    Posts
    6

    Default RE: Resorting a drop-down list dynamically from string input in a separate text field

    http://www.infohiway.com/javascript/indexf.htm?seasons<BR><BR>this is a link to a solution to your problem, the thing is that and event should trigger the redraw of the values in the list box, this is a refresh, and maybe it will not be very fast if you are considering the time it will take to load a page with so many records in a text box.<BR><BR>I hope this link gives you a solution or a view to a solution to your problem.<BR><BR>The only thing that you will have to change is the event that triggers the refresh, you will have to gange it to an On_change of the input box where you are typing the name to search.<BR><BR>Edgar Sosa<BR>esosa@innova.com.mx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •