Autocomplete and Dynamic Parameter Passing

Posted by abcParsing on Stack Overflow See other posts from Stack Overflow or by abcParsing
Published on 2010-04-24T19:03:00Z Indexed on 2010/04/24 19:13 UTC
Read the original article Hit count: 407

Filed under:
|

The code below works fine using jQuery UI 1.8 and jQuery 1.4.2

$("#sid_entry_box").autocomplete( {source:"autocomplete_sid.php?database="+database_name,
 minLength:4,
          delay:1000,
          enable:true,     cacheLength:1
  });

The database name is passed as a get parameter of the php call.

In this application, I have two databases selected by a radio button. Since jQuery loads and assigns this function when the document is loaded, the database name is whatever was checked at that momemnt.

What I really need to pass to the php call is the following: database=$("input[name=rf_database_option]:checked").val();

Is ther ean easy to understand way to be able to pass a dynamic dom value?

© Stack Overflow or respective owner

Related posts about autocomplete

Related posts about jQuery