| | |
help for auto complete text box
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2007
Posts: 12
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Jan 2006
Posts: 275
Reputation:
Solved Threads: 11
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.
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.
![]() |
Similar Threads
- writing from bottom up in rich text box (VB.NET)
- auto completion of the text box from previous entered values (JavaScript / DHTML / AJAX)
- per word auto complete (HTML and CSS)
- text is being written in text box (Web Browsers)
- Help with text box height (HTML and CSS)
- turning off auto complete. (Windows NT / 2000 / XP)
- Cannot enter any text in a IE text-box (Viruses, Spyware and other Nasties)
Other Threads in the ASP.NET Forum
- Previous Thread: How to print the items in a datagrid in ASP .Net
- Next Thread: Problem Inserting into SQL database on server
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax alltypeofvideos asp asp.net bc30451 bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn checkbox class click commonfunctions compatible confirmationcodegeneration content contenttype countryselector courier css dataaccesslayer database datagrid datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dropdownmenu edit expose flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list listbox login menu microsoft mono mouse mssql multistepregistration nameisnotdeclared news numerical objects order panelmasterpagebuttoncontrols problem radio ratings rotatepage save schoolproject search security serializesmo.table silverlight smartcard sql sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webservice wizard xml youareanotmemberofthedebuggerusers





