help for auto complete text box

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2007
Posts: 12
Reputation: aerian is an unknown quantity at this point 
Solved Threads: 0
aerian aerian is offline Offline
Newbie Poster

help for auto complete text box

 
0
  #1
Apr 25th, 2007
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:
[
<
htmlxmlns="http://www.w3.org/1999/xhtml">
<
headrunat="server">
<title>Untitled Page</title>
<
scriptlanguage="javascript"type="text/javascript"src="actb.js"></script>
<
scriptlanguage="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>
<
formid="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
Reply With Quote Quick reply to this message  
Join Date: Jan 2006
Posts: 275
Reputation: f1 fan is an unknown quantity at this point 
Solved Threads: 11
f1 fan f1 fan is offline Offline
Posting Whiz in Training

Re: help for auto complete text box

 
0
  #2
Apr 26th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC