hye
i m working on a n autocomplete textbox.
here the text box is binded through only specific values defined in array.
i want to bind the text box through the values selected from data base .
how can i retrieve the database values here.
the code is as follows
CODE:
[
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script language="javascript" type="text/javascript" src="actb.js"></script>
<script language="javascript" type="text/javascript" src="common.js"></script>
<script>
var customarray=new Array('an apple','alligator','elephant','pear','kingbird','kingbolt', 'kingcraft','kingcup','kingdom','kingfisher','kingpin');
var custom2 = new Array('something','randomly','different');
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<!--<input type='text' style='font-family:verdana;width:300px;font-size:12px' id='tb' value=''/>-->
<script>
var obj = actb(document.getElementById('TextBox1'),customarray);
//setTimeout(function(){obj.actb_keywords = custom2;},10000);
</script>
</div></form>
</body>
</html>
]

i shall b v.thankful

you would have to write javascript so that on each keypress you would check the script against the array and return the next item in the array.

If you wanted to do it server side you can do the same against a larger array using ajax. AFAIK MS Ajax 1.0 has an autocomplete extender for a text box out of the box.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.