JS AutoSuggest functionality

Discussion in 'JavaScript' started by gouldtv, Jun 28, 2007.

  1. #1
    I'm so close to having this working - - - I'm basically trying to add functionality to a tutorial on autosuggest drop-downs for fields, found here:

    http://www.webreference.com/programm...t/ncz/column3/


    To describe what I'm trying to do, I'll have to point you to some URLs:

    1) http://www.librarytools.com/shipping/waybill.php?userid=1?formnum=1

    Here's the input form I'm working on. Notice how you can type into the Air WayBill field and the dropdown works. Yay!

    2) http://www.librarytools.com/shipping/suggestions3a.js

    Notice how the data available is actually 3 columns. What I need to somehow accomplish is to make it so that when the user hits ENTER, the "prefix" number in the 3rd column gets inserted into another field on the page. I can handle putting the value into a field on the page - - - I just need help getting the value out of the array upon ENTER.

    3) http://www.librarytools.com/shipping/autosuggest2.js


    See the logic in the above URL. :)So somehow, I need to pass the selected airline's prefix # to the handler in autosuggest2.js that handles the ENTER key. The problem that I'm seeing is that there's no way to get the index-number of the array of data when the enter key is pressed, to determine the entry. It's tricky, and I'm way over my head with JS prototyping and OOP logic in this tutorial. If someone could get me past this last hurdle, I should be able to use this technique throughout - - - and others would benefit too.

    Thanks in advance to anyone who can help! Very much appreciated.
     
    gouldtv, Jun 28, 2007 IP