OK so i've been working on this code solid for 24 hours now and could really do with some help, I'm sure it's nothing much, but I don't have much experience with javascript.
<%@LANGUAGE="VBSCRIPT"CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%
dim objRs
dim arrPDFs
dim javascriptArrayValues
Function GetPDFsArray()
Set connString = Server.CreateObject("ADODB.Connection")
set objRS = Server.CreateObject("ADODB.Recordset")
connString.ConnectionString ="dsn=floor;uid=floor;pwd=floor;"
connString.Open
mySQL = "SELECT * FROM Companies"set objRs = connString.Execute(mySQL)
If NOT objRs.EOF OR NOT objRs.BOF Then
GetPDFsArray = objRs.GetRows()
Else
GetPDFsArray = ""
End If
End Function
'Get array
arrPDFs = GetPDFsArray
If isArray(arrPDFs) Then
for i=0 to uBound(arrPDFs,2)
javascriptArrayValues=javascriptArrayValues & """" & arrPDFs(0,i) & """" & ","
next 'i
javascriptArrayValues=Left(javascriptArrayValues,Len(javascriptArrayValues)-1)
Else
javascriptArrayValues = "Error: No results for array"
End If
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<input type="text" name="pdfDesc" id="pdfDesc" autocomplete="off" />
<script>
customarray = new Array(<%=javascriptArrayValues%>);
actb(document.getElementById("pdfDesc"),customarray);
</script>
</head>
<body>
</body></html>
As I said the page loads, but the autocomplete does nothing.
Thanks in advance to anyboby that takes the time to read this.
I'd like to be able to show the autocomplete list from within a different javascript function. Is there a function I can call?
My scenario is this: the user uses an on-screen keyboard which fires events to fill the textbox. The autocomplete works great when using an actual keyboard, but when they click the keys on the on-screen keyboard (input buttons), the list is not generated. If there is a way I can show the autocomplete list from what is already in the textbox, that would be excellent!
Well I eventually got this great bit of Javascript to pull the list of keywords from a .txt file via AJAX's XMLHttpRequest() to save hitting on the database every pageload. I plan on running a cronjob to update the file once a day from the database with the most popular keywords. Tested in IE6, IE7, Firefox 2 and Opera. The only problem I have encountered so far is the keydown, keypress etc event not working properly in Opera 9. Anyone had any success/failure in Opera with the keydown events too?
Thanks again for this great code. I am using it on a new site of my own due to go live very soon which will be a commercial site so thought I better ask if this will be okay.
Zichun, I desperately need your help! I'm working on a site using your control (easily the best one on the web, I hope you don't mind). And I'd like to call it from within a jQuery ThickBox. http://jquery.com/demo/thickbox/
The two problems I am experiencing are:
1. The auto complete renders from the "non-scrolled" location of the thickbox's text field i assigned it to. If you're scrolled down, you can't see it at all.
2. The auto complete control renders behind both the thickbox and the transparent gray that darkens the page.
I tried messing with z-index stuff, but I couldn't figure it out.
I have to use the thickbox, and I love your auto complete so much that I can't use a different one. Any help or guidance you can give me would be good. My email is henderson.mark@gmail.com, please contact me ASAP!
i am using an asp.net textbox that has an onChange event client side attach to it. when adding this widget the onChange event doesn't raised. is there any reason why
Well I am using this feature and it works great.Only limitation is that it does not support '&' (eg: A&A does not appear on typing 'a' , it does appear on typing a& ) though it supports most other special characters. Just wanted to know where I could change in the code to escape this character.
Hi,
I m doing my engineering graduate project named "Digital library search-Thirukkural" in tamil.I need to finish the auto complete module in it.Can this work with tamil languauge. Also i am doing the project in java and ms-access.Please elaborately explain how to include this in my project.Urgent plzzzzz
But is there an easy amendment to allow the script to use the multiple text searches to be applied to one outcome?
i.e. if I use the comma as the delimeter in this example:
an, app,
I would like both those separated words to be applied to the search and return the result "an apple" and replace the 2 searched words with the result "an apple"
But did you put the newly built javascriptarray string into the HTML like this:
<input type="text" name="pdfDesc" id="pdfDesc" autocomplete="off" /><br />
<script><br />
customarray = new Array(<%=javascriptArrayValues%>);<br />
actb(document.getElementById("pdfDesc"),customarray);<br />
</script>code><br />
<br />
So the Text box above will be bound the js asin the original example, but instead of hardcoding the array values, just drop in the variable name.
Could someone help me achieve this using ASP.NET vs ASP and VBscript? I want the same results (sql populated array) but am too inexperienced to figure out how .
I really like your ACTB script. I use it instead of DevExpress comboboxes everywhere now. MUCH faster
I'm working on an in-house project(not for sale or anything) and would like to know if its okay to use in the application? In documentation I have put credit for this script to this article.