Question : jquery auto complete

Hi,

I am trying to build a jquery auto complete search box, at the preset time users can only search through one parameter for example first name.
What i want is to have a radio button like in the example http://www.devbridge.com/projects/autocomplete/jquery/

so far i have the below code.

All i need to know is in the javascript what code can i right so that if the radio button is clicked then it calls 2.ashx instead of Search_CS.ashx

Please help

Thanks,

R8VI
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
<script type="text/javascript">
    
$(document).ready(function() {
        $("#<%=txtSearch.ClientID%>").autocomplete('Search_CS.ashx');
    })

    </script>

<asp:RadioButton ID="FirstName" runat="server" Text="First Name" GroupName="Search" />
            <asp:RadioButton ID="LastName" runat="server" Text="Last Name" GroupName="Search" />
            <br />
            <br />
            <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>

then i have a .ashx file that talk to the database.

Answer : jquery auto complete

sorry you should change this line then
            var chk = $('input[name^="Search"]:checked');
with
            var chk = $('input[name^="Search"]:checked').attr('id');

so code below



i'm on a mac for this week, can't replicate your script
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
<script type="text/javascript">
	$(document).ready(function(){
	
		var chk = $('input[name^="Search"]:checked').attr('id');
	
		liveSearch(chk)
	
		$('#FirstName').click(function(){
			liveSearch('Search_CS.ashx')
		});
		$('#LastName').click(function(){
			liveSearch('2.ashx')
		});
	});
	
	function liveSearch(page){
		$("#<%=txtSearch.ClientID%>").autocomplete(page);
	}
</script>
Random Solutions  
 
programming4us programming4us