|
|
 Prize winner in Competition
"Best ASP.NET article of Jul 2007"
Comments and Discussions
|
|
 |

|
Hi,
I am using the code below to dynamically create array with data flowing in from an MDB file named test_db.mdb,
But anyhow this dosent seem to work. Please help
Thanks
Salan
------------------------------------------------code ---------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html dir="ltr" xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Autosuggest test page</title>
<!-- Page styles: -->
<style type="text/css">
input
{
font-size: 12px;
font-family: verdana;
width: 300px;
}
table
{
width: 100%;
text-align: center;
}
</style>
<!-- Autosuggest includes: -->
<link rel="stylesheet" type="text/css" href="autosuggest.css"></link>
<script type="text/javascript" src="autosuggest.js"></script>
<!-- Autosuggest data: -->
<script type="text/javascript">
var custom_array = [
<%
Set MyConn = Server.CreateObject("ADODB.Connection")
MdbFilePath = Server.MapPath("test_db.mdb")
MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & MdbFilePath & ";"
salan1 = "SELECT count(*) as Total FROM area"
Set salan2 = MyConn.Execute(salan1)
SQL_query = "SELECT * FROM area"
Set RS = MyConn.Execute(SQL_query)
WHILE NOT RS.EOF
i=i+1
res = i
if res < salan2("Total") then %>
'<%=RS("word")%>', <% end if %><% if res = salan2("Total") then %> '<%=RS("word")%>' <% end if %>
<%
RS.MoveNext
WEND
%>
];
</script>
</head>
<body>
<input type="text" id="tb" value="" />
<script type="text/javascript"> new autosuggest("tb", custom_array); </script>
|
|
|
|

|
Hi all,
Is it possible to turn off the suggestions after and particular character example "=" and then continue once the delimter is typed.
please help me out...
|
|
|
|
|

|
Nice work...
|
|
|
|

|
the lastest version works like magic both in IE6 and firefox. I use client side array with more than 100,000 elements!! works resonably fast... Thanks to the author!!!!
|
|
|
|

|
I've got 8 choices only, so I would like the suggestions to show up at the onFocus event. How would I do this?
|
|
|
|

|
That is I don't want to have to type a character for the suggestions to show. . .
|
|
|
|
|

|
hello.
I'm not good at English,but I'm trying to describe it clearly,please keep pacience.
the suggestion never appear when I type something such as "abc" in the field,but when I delete them all with "backspace" key quickly it appears.it will not appear if I delete them slowly.I test it with IE and firefox,they are same result.
another question:it seems the start_check never works when I use ajax fetch data.it gets data when I input the first character despite I set it like this:
this.start_check = 2;
it will overload the server.
here is the demo:http://121.63.222.140/tickets/index_ajax.html[^]
thank any ideas.modified on Sunday, March 7, 2010 6:21 AM
|
|
|
|

|
I get it.
just because this script will filter the return data got from webserver again.
thank Dmitry Khudorozhkov and zichun for sharing this.
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
This article presents code that augments any INPUT box with an auto-suggest feature, AJAX-capable
| Type | Article |
| Licence | Zlib |
| First Posted | 24 Aug 2007 |
| Views | 370,885 |
| Downloads | 1,759 |
| Bookmarked | 197 times |
|
|