|
Thank you for your code, it is nice.. I want to ask, how to showing all of the list when mouse clicked in the textbox?
thank's for the advice
|
|
|
|
|
Hi,
to do it, you need to add the following code to the end of setupEvents method:
var obj = this;
if(!this.displayed)
{
setTimeout(function()
{
obj.preSuggest(-1);
},
25);
}
Hope it helps,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
thank you for your's advice but it still not working when i click in the textbox
there are my code :
setupEvents: function()
{
this.addEvent(document, "keydown", this.funcCheck);
this.addEvent(this.field, "blur", this.funcClear);
this.addEvent(document, "keypress", this.funcPress);
var obj = this;
if(!this.displayed)
{
setTimeout(function()
{
obj.preSuggest(-1);
},
25);
}
},
|
|
|
|
|
Sorry for giving advice with untested code - it was very late :\
The following variant of setupEvents does work - tested it right now:
setupEvents: function()
{
this.addEvent(document, "keydown", this.funcCheck);
this.addEvent(this.field, "blur", this.funcClear);
this.addEvent(document, "keypress", this.funcPress);
if(!this.displayed)
{
var obj = this;
this.timer = setTimeout(function() { obj.preSuggest(-1); }, 25);
}
},
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
thank you very much Dmitry, it is works
|
|
|
|
|
First, thanks for the great work.
I was using zichun script, but reading the comments I discovered yours, which addresses most of the issues I was trying to fix by myself. The script is working fine, with a few details:
1. Using this.use_scroll = true; in FF3 works OK, but in IE7, when mouse clicking on the scroll bar, the result list closes.
* Is there some simple fix?
2. In IE7, Start and End keys work both for setting the cursor to the beggining/end of the input and at the same time also for moving to the first/last row in the list.
In FF3, Start and End keys are only good for moving within the list, but not in the textbox.
* Is it possible to replicate IE behaviour in FF3 or at least have the same behaviour in both?
3. When resizing the page with open list, IE7 positions OK, but FF3 moves the list to some position other than under the textbox.
* Is it fixable?
Hint: this does not happens in zichun version Auto-complete Control[^]
4. Suggestion: add version number to the script, so people will know if some comment applies to their versions or not.
Best Regards!
PS: I already voted for the script
modified on Wednesday, May 13, 2009 10:22 AM
|
|
|
|
|
Good evening,
egoman69 wrote: 1. Using this.use_scroll = true; in FF3 works OK, but in IE7, when mouse clicking on the scroll bar, the result list closes.
* Is there some simple fix?
Try to look at the lines 203 and 205 of script - these control the behavior when clicking on the scroll bar.
egoman69 wrote: * Is it possible to replicate IE behaviour in FF3 or at least have the same behaviour in both?
I'll try to fix it tomorrow - probablysome glitch in onkeypress behavior.
egoman69 wrote: 3. When resizing the page with open list, IE7 positions OK, but FF3 moves the list to some position.
Will try to fix it too.
egoman69 wrote: I already voted for the script
Thank you much ))))
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
WOW, great response time (15min).
I'll be looking forward by pressing F5 every 5 minutes to see if the update appears (just kidding)
Thanks in advance.
modified on Wednesday, May 13, 2009 6:40 PM
|
|
|
|
|
|
Good evening,
in the last 2 days I'm a bit overwhelmed with the amount of work upon me, so I had no time to look at the script issues. I'll definitelly do so on the weekend.
Sorry for delay & best regards,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
OK with me. I'll be back to u next week.
Thanks for your time again.
Regards
|
|
|
|
|
Hi Dmitry
Have you been able to check the issues on IE7?
I tried to fix them with no luck...
Thanks & Regards
|
|
|
|
|
Dmitry
Since you're overwhelmed with the amount of work, I've tried to help by addressing other users issues so you might have more time to work in these issues. Plz, check them when you can and let me know what else can I do.
Best Regards
|
|
|
|
|
Hi there
Any news this week?
|
|
|
|
|
Ohhhh... I wish I had 48 hours in a day
Currently I'm buried under my job, so no firm dates, sorry. But will try to work out something by Sunday.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Yipee, that would be a nice present for my birthday (this Sunday)
advthnkz
|
|
|
|
|
Hi Dimitry,
I'm trying to implement your code within an ASP page that calls another ASP page to retrieve data from a database.
Now I can see that the response text is being returned in the correct format as xml but I don't see the suggestion box.
I've initialised the javascript in the body of the page following the input box.
This is the code as I want to utilise two values returned in the XML (it reads <listdata>Value1a,Value1b|Value1a,Value1b</listdata>
<script language="javascript" type="text/javascript">
new autosuggest("tb", "", "http://someIP:port/directory/getdata.asp?ot="), function(index, control) {alert("You've selected the key: " + control.keywords[index]); });>
Any ideas?
|
|
|
|
|
Hi David,
XML and initialization script looks correct (although I'd write:
new autosuggest("tb", null, "http://someIP:port/directory/getdata.asp?ot=") )
What you can do first is put the debugging alert into preSuggest method, right after:
if(this.suggest_url.length) to see if you ever enter the AJAX block. If it works, put an alert after:
var text = http.responseText;
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Another one: please load your page in Firefox. Any messages in error console?
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Dimitry, thanks for coming back so quickly.
Yes it does enter the code block and I can alert the responsetext. No console errors are reported in Firebug in Firefox.
One other thing I noticed is that if I use this:-
http.open("GET", this.suggest_url + ot_, true);
then the suggestions returned by the responsetext do not update, it looks like only the first character entered in the input field is passed to the data lookup script.
If I use this:-
http.open("GET", this.suggest_url + t, true);
then I get a more tailored response in the responsetext.
So it seems that I can pull back the data ok, but just not display it?
Thanks
|
|
|
|
|
David Raywood wrote: So it seems that I can pull back the data ok, but just not display it?
It seems so.
Next try with alerts: in the suggest method, put
alert(this.total); just before the call to this.startTimer(0); . Does the alert show a legit number (>0)?
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
|
Interesting. What values of keys (limit_start, match_first - look at the start of script file) do you use?
Try to set all to true.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
OK I've set everything to true, but the suggestion list still doesn't appear.
It has resolved the problem whereby only the first character of the query was being passed to my lookup script though.
I wonder if some other page element is hiding the suggestion list.
|
|
|
|
|
David Raywood wrote: I wonder if some other page element is hiding the suggestion list.
If this.total shows 0 , then the suggestion list won't get created, so the problem is either in script, or in the data you retrieve.
Let's return to the preSuggest method. Find the line:
var keyword_number = that.keywords.length;
Put the alert(keyword_number). What does it show?
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|