943,946 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 5834
  • ASP.NET RSS
Apr 25th, 2007
0

help for auto complete text box

Expand Post »
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
Similar Threads
Reputation Points: 9
Solved Threads: 0
Newbie Poster
aerian is offline Offline
12 posts
since Apr 2007
Apr 26th, 2007
0

Re: help for auto complete text box

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.
Reputation Points: 26
Solved Threads: 11
Posting Whiz in Training
f1 fan is offline Offline
275 posts
since Jan 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: How to print the items in a datagrid in ASP .Net
Next Thread in ASP.NET Forum Timeline: Problem Inserting into SQL database on server





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC