Automcomplete and Lightbox Popupwindow

Automcomplete and Lightbox Popupwindow

Hi, i use a jquery autocomplete textbox. if the user press the the search button a lightbox popup will display. take a look to the source. i replace a link with a new link and the found id of the autocomplete box.but that works only if the user select something.
if he select nothing , i want change the link with the entered query string . something like
Popup.aspx?q=test

but how can i get the entered query string of my textbox (txtsearch) ?




 

 

 

var xUrl = '<%=ResolveUrl("~/Search_VB.ashx") %>';
        //ctl00$ContentPlaceHolder1$txtsearch''#<%=txtsearch.ClientID%>
        $("#<%=txtsearch.ClientID%>").autocomplete(xUrl, {
            width: 220,
            selectFirst: false
        });




        $("#<%=txtsearch.ClientID%>").result(function(event, data, formatted) {
            if (data)
                $(this).parent().next().find("input").val(data[1]);
            val = data[1];
            var xUrl1 = '<%=ResolveUrl("~/Popup.aspx?ID=" ) %>';
            $('#cmsearch').attr('href', xUrl1 + val);
            });