Problem: autocomplete post hidden input values to the query page

Problem: autocomplete post hidden input values to the query page

Hi,

I have an autocomplete script using for some purposes. I have modified (added) some custom javascript to use it for my job.
It is used with (multi) step by step selection. Like "select the cities you have been ever". If a user selects a city its value is passed to a hidden input and after that if user can select another city and its value is added to the input and so on, which are splitted by brackets (like 11,43,65)

The problem is, I want the user can not see the city he/she just have selected. To do this, I want to take the hidden inputs value and send it to the aspx page by querystring. Where the query gets this value and search the city list without these values ( sql speaking "select city from cities where cityId not in (these values)).

What I am doing in the code is as follows:

  1. <script type="text/javascript">  
  2.     $(document).ready(function() {  
  3.         $("input#<%=txtCityName.ClientID %>").autocomplete('citysearch.aspx.?cityIds='+$('selectedcityIds').val()).result(function(event, item) {  
  4.             $("#<%=txtCityId.ClientID %>").val(item.toString().split(",")[1]);  
  5.         });  
  6.     });      
  7.     </script> 
Look the querystring sent to the aspx page here:
citysearch.aspx.?cityIds='+$('selectedcityIds').val()

I have a hidden input in the page whose id is selectedcityIds.

It seems it should be worked. But its not the case. The inputs value is taken as null here. If I write custom numbers there (like citysearch.aspx.?cityIds=11,43,38') it is worked. But when I want to get the inputs value, it gets null.

I tried to solve it for a whole day but I couldn't.

I wish I could have explained what I want to do.

I would be appreciated if you help me.
Best regards.
Erhan saydam