Showing a value and passing another to a URL

Discussion in 'JavaScript' started by BaseballGraphs, Sep 8, 2010.

  1. #1
    Hello,

    I am currently working on a project that allows people to search a table in my database, select a name from the database, and then get passed to another page where the name's id from the table in my database is used.

    Here is the current code that I am dealing with: http://pastie.org/1147187

    What I am doing is getting my two columns from my table, PLAYER_NAMES and PLAYER_ID. Then, using javascript, I am creating an autocomplete field where users can begin typing a PLAYER_NAME and select the player they want. However, I do not want to pass the PLAYER_NAME to the URL -- instead, I would like to pass the PLAYER_ID to the URL.

    How can I improve my code so that when a user selects a player value the player's ID is passed through to the URL using javascript?

    I would seriously appreciate any help.

    Thanks!
     
    BaseballGraphs, Sep 8, 2010 IP