Link to home
Start Free TrialLog in
Avatar of fedkris
fedkris

asked on

retrieve a parameter from script (asp)

hey,

i have a search box, when i search, i see the results, when i click on it, i need only to retrieve the parameter "id",

the results are: firstname, lastname and id

how can i do that, idea's?

thx


(this is de loaded code:

<script>
      $(function() {
            var data = [

                       {label: "Bourins step", category: "29" },{label: "de Quirini Guibert", category: "28" },{label: "Defever Simone", category: "21" },{label: "degreve antéon", category: "24" },{label: "delfosse jan", category: "79" },{label: "delhez kristof", category: "78" },{label: "Dereumaux Catherine", category: "26" },{label: "devos jan", category: "82" },{label: "ellen verstraete", category: "86" },{label: "Gonsalez Jeremy", category: "22" },{label: "jan Simon", category: "74" },{label: "Jockir Jeremy", category: "30" },{label: "kkkkk ", category: "80" },{label: "Michiels Mireille", category: "25" },{label: "Renier Geraldine", category: "23" },{label: "slaets veronique", category: "87" },{label: "timmer anne", category: "85" },{label: "timmer anne", category: "84" },{label: "timmer anne", category: "83" },{label: "vermeire alain", category: "81" },{label: "verstrate ellen", category: "31" },
                  
            
            ];            

            
            $( "#search" ).catcomplete({
                  delay: 0,
                  source: data
            });
      });
      </script>
)

i only want the id of the choosen person...


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
	<link rel="stylesheet" href="jquery-ui-1.8.16.custom/development-bundle/themes/base/jquery.ui.all.css">
	<script src="jquery-ui-1.8.16.custom/development-bundle/jquery-1.6.2.js"></script>
	<script src="jquery-ui-1.8.16.custom/development-bundle/ui/jquery.ui.core.js"></script>
	<script src="jquery-ui-1.8.16.custom/development-bundle/ui/jquery.ui.widget.js"></script>
	<script src="jquery-ui-1.8.16.custom/development-bundle/ui/jquery.ui.position.js"></script>
	<script src="jquery-ui-1.8.16.custom/development-bundle/ui/jquery.ui.autocomplete.js"></script>
	<link rel="stylesheet" href="jquery-ui-1.8.16.custom/development-bundle/demos/demos.css">
	<style>
	.ui-autocomplete-category {
		font-weight: bold;
		padding: .2em .4em;
		margin: .8em 0 .2em;
		line-height: 1.5;
	}
	</style>

</head>

<body>


<%
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=" & Server.MapPath("database.accdb")


%>




	<script>
	$.widget( "custom.catcomplete", $.ui.autocomplete, {
		_renderMenu: function( ul, items ) {
			var self = this,
				currentCategory = "";
			$.each( items, function( index, item ) {
				if ( item.category != currentCategory ) {
					ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );
					currentCategory = item.category;
				}
				self._renderItem( ul, item );
			});
		}
	});
	</script>
	<%
		Set rst2= Server.CreateObject("ADODB.Recordset")
	strsql2 = "SELECT * from contacts order	by lastname"
	rst2.Open strsql2,adoCon,,3


	%>
	<script>
	$(function() {
		var data = [

                       <%  
                         if not rst2.eof or not rst2.bof then ' make sure there is data
                              do until rst2.eof 'start loop
                              response.write "{label: """&rst2("lastname") &" "&rst2("firstname") &""", category: """&rst2("idcontact") &""" }," 'sample data { label: "annhhx10", category: "Products" }
                              rst2.movenext
                              loop
						end if
                        %>
			
		
		];		

		
		$( "#search" ).catcomplete({
			delay: 0,
			source: data
		});
	});
	</script>


<input type="text" id="search" />
</body>

</html>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fedkris
fedkris

ASKER

thx for all!