Author |
Topic |
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 09 September 2008 : 09:43:28
|
Does anyone know what it is called when a search box is filled in for you as you type?
I think YouTube has this feature for their search box.< |
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 09 September 2008 : 10:08:14
|
Thanks Marcel!
I just needed some search terms to Google it.
Etymon < |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 09 September 2008 : 11:34:27
|
it is easy to create a MOD for that, but you need to consider what do you want to be complete textbox...
there is always to ways:
- an Offline, when the user page loads all the words are already in the code ready to be used, and it is the fastest - an Online, where it uses AJAX technology to query the database using the word that the user just wrote, then get the results and write as a dropdown... this take time depending on the user connection and your forum / database, and per each letter there is a new query sent to the database.
if you want help... please let us know what do you want to accomplish.< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 09 September 2008 : 12:58:45
|
Thanks for the help on that.
Maybe the autocomplete is not what I am looking for specifically.
What I want it for is Private Messages for the Send to: textbox. I just want it to autocomplete available member names.
< |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 09 September 2008 : 13:31:00
|
how good / comfy are you with ASP / HTML / Snitz?< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 09 September 2008 : 13:33:39
|
It's like home to me. (um, well, most of the time )< |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 09 September 2008 : 14:04:08
|
good...
here you have:
http://www.balexandre.com/snitz/autocomplete/
now all you need, is to apply a query to get all names/emails form the current user and format it accordingly
to test the emails you can see the code, to see what names can you search.
Hope that this give you the way to build what you need.< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
Edited by - balexandre on 09 September 2008 14:10:24 |
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 09 September 2008 : 14:10:29
|
Hey!
I saw jQuery as I was searching.
I'm assuming that I need to do a view source, get the files and go from there.
Thanks balexandre! < |
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 09 September 2008 : 14:16:48
|
Javascript is one of my weaker points.
In var emails below, how do I query the db and put the results into a list like below? I know ... talk about an Achilles heel.
var emails = [ { name: "Peter Pan", to: "peter@pan.de" }, { name: "Molly", to: "molly@yahoo.com" }, { name: "Forneria Marconi", to: "live@japan.jp" }, { name: "Master <em>Sync</em>", to: "205bw@samsung.com" }, { name: "Dr. <strong>Tech</strong> de Log", to: "g15@logitech.com" }, { name: "Don Corleone", to: "don@vegas.com" }, { name: "Mc Chick", to: "info@donalds.org" }, { name: "Donnie Darko", to: "dd@timeshift.info" }, { name: "Quake The Net", to: "webmaster@quakenet.org" }, { name: "Dr. Write", to: "write@writable.com" }< |
Edited by - Etymon on 09 September 2008 14:22:21 |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 09 September 2008 : 14:34:47
|
that's ASP ... forget that is Javascript, all you need to do is very simple, look:
You need to grab the name and email using a SQL Query, I do not have the PM mod and never used (I think that takes the essential of a forum), but I will do this as steps.
the code you see there is:
<script type="text/javascript">
// Emails that you can use in auto complete var emails = [ { name: "Peter Pan", to: "peter@pan.de" }, { name: "Molly", to: "molly@yahoo.com" }, { name: "Forneria Marconi", to: "live@japan.jp" }, { name: "Master <em>Sync</em>", to: "205bw@samsung.com" }, { name: "Dr. <strong>Tech</strong> de Log", to: "g15@logitech.com" }, { name: "Don Corleone", to: "don@vegas.com" }, { name: "Mc Chick", to: "info@donalds.org" }, { name: "Donnie Darko", to: "dd@timeshift.info" }, { name: "Quake The Net", to: "webmaster@quakenet.org" }, { name: "Dr. Write", to: "write@writable.com" } ];
so you do something like.
<script type="text/javascript">
// Emails that you can use in auto complete var emails = [ <% usernameID = "1" ' I dont know where the PM gets the current ID strConnString = "SELECT NAME, EMAIL FROM TABLE WHERE USERID = " & _ chkString(usernameID,"SQLString")
set my_Conn = Server.CreateObject("ADODB.Connection") 'on error resume next my_Conn.Open strConnString
while NOT my_Conn.EOF
%>{ name: "<%= myConn("NAME") %>", to: "<%= myConn("EMAIL") %>" },<%
my_Conn.moveNext() wend
my_Conn.Close set my_Conn = nothing %> ];
something like that...
if my ASP is wrong please let me know, to much time sick around bed with no code whatsoever... I'm getting blanks now
and here you have a zip file (test it please, i'm on a )
http://www.balexandre.com/snitz/autocomplete.zip< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
Edited by - balexandre on 09 September 2008 14:51:14 |
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 09 September 2008 : 14:42:27
|
I feel like a
You made it so simple for me. Thank you!
I hope that you are feeling better soon!
< |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 09 September 2008 : 14:48:26
|
glad it helps...
I know it's a virus, but no one knows witch one, so, no treatment, just fevers
been like this for more than 3 weeks now ... < |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 09 September 2008 : 15:33:53
|
It's NO fun being sick!
I just got over something myself. Don't want to go there again!
Thank you again for the help.
Sincerely,
Etymon < |
|
|
|
Topic |
|
|
|