|
I've answered this in private - this feature will be available in the next release.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi Dmitry,
I've got another question one for you.
The autocomplete doesn't position itself correctly if the user increases the size of the font on the page. By increasing the font size, I mean when the user does a Ctrl++ or Ctrl+- key combination in Chrome or Firefox.
By reading the code, it seems like the autocomplete is being drawn with pixel as its unit of drawing. Should it be changed to the em unit?
Thanks,
Louis
|
|
|
|
|
Hi Dmitriy,
Great work on the auto-suggest. Lots of patience to get something that surpass the competition out there (and its free)!
Would it be possible to display the auto-suggest control when the textbox gets the focus and its empty? If so, how easy is it to do? I've tried a couple of combinations like actb_generate() followed by actb_table_highlight() without any luck.
I had a second question? If the word typed in the textbox doesn't exits in the auto-suggest control, would it be possible to change the background color of the textbox (ex: red). Where should I look in the code to implement such a feature?
Thank you for your time,
Louis-Philippe
|
|
|
|
|
Hi, sorry for delay.
Louis-Philippe Carignan wrote: Would it be possible to display the auto-suggest control when the textbox gets the focus and its empty?
You (almost) got it now - see the example in the download archive and press down key; all you have is to transfer the code from actb_checkkey method to a new function that will be called onfocus (see construct method). Also - it works only with client-side arrays.
Louis-Philippe Carignan wrote: If the word typed in the textbox doesn't exits in the auto-suggest control, would it be possible to change the background color of the textbox (ex: red).
Look at the following block at the start of actb_generate method:
if(this.actb_total == 0)
{
this.actb_display = false;
return;
}
You should place the this.actb_curr.style.backgroundColor = "#f00"; there.
Hope it helps,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi Dmtriy
This was going to be my next questions. Have implimented it and it works fine but once its turned to red even when the text returns a positive search it stays red. How can we get it to go back to white if a positive result is found.
|
|
|
|
|
Hi
Forget the last post I have fixed it works like a dream now , great addition to the search box
|
|
|
|
|
Hi great script, have it installed in test and it works! The only problem I have is the speed that it returns the suggestions.
I am accessing a DB with about 30,000 records in, a list of locations that we provide the service in. When I type in it seems to take a long time to get the suggestion, even though when I do the exact same search in raw PHP the results are almost instant.
I have also noticed that it seems to be doing searches after every char is enter after the first three and when I set this.actb_fullRefresh = false; i get no results
Please can you offer some help in how to speed it up
Here is the test link you can see it working http://www.gostarmedia.com/aatest/autosuggest.php
I await in anticipation
|
|
|
|
|
Hi,
gostar wrote: Here is the test link you can see it working http://www.gostarmedia.com/aatest/autosuggest.php
Tested it - and it works perfectly for me (made a quick test in FF and Chrome).
Also - you're using a client-side array now; can you please provide a page with AJAX retrieval?
Best regards,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
http://www.gostarmedia.com/aatest/outa.php this is the xml output
|
|
|
|
|
Ps the number of records i gave you was incorrect when fully loaded it has 92,000 records to browse
|
|
|
|
|
Hi Dimitry
I think i have sourced the problem, when i look at what sent to the XML file it seems to only send the first letter thats typed in e.g if i type in Mala it only sends M
http://www.gostarmedia.com/aatest/autosuggest.php
Any ideas?
|
|
|
|
|
Hi,
gostar wrote: I think i have sourced the problem, when i look at what sent to the XML file it seems to only send the first letter thats typed in e.g if i type in Mala it only sends M
This is the exact functioning of original zuchin's code (that I haven't changed); script retrieves data for a first letter, and then filters the received data. This is some sort of client-side caching.
Do you want it to send the whole string?
- Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi Thanks for the reply
I have now finally got it working as long as the this.actb_fullRefresh = true; is set to true it is working very well. If set to false it does not seem to work at all. Just one issue now and that is when the list contains enough in the suggestions list to generate a side bar the mouse will not work on the side bar up and down arrow keys,
How can i send you it all Please advise
Thanks
|
|
|
|
|
gostar wrote: Just one issue now and that is when the list contains enough in the suggestions list to generate a side bar the mouse will not work on the side bar up and down arrow keys,
Can you please tell me how to replicate this issue (on the links you posted earlier)?
- Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi Dmitriy
Sorry be away for a few days.
To replicate the problem you can go to http://www.gostarmedia.com/newsearchbox.php and if you put in the pickup location "Los An" with out the quotes you will get a large list and see that if you try to scroll down using the down arrow with the mouse it just closes the list.
I now also have another problem is i copied the js file and the html page to my other website www.otmcapital.com/newsearchbox.php and it does not work at all. it does not seem to like accessing the XML feed from a remote site on a remote sever, any ideas on this would be perfect as i need to install the search box on around 2000 websites
Happy New Year and hope you can help
Gostar
|
|
|
|
|
gostar wrote: To replicate the problem you can go to http://www.gostarmedia.com/newsearchbox.php and if you put in the pickup location "Los An" with out the quotes you will get a large list and see that if you try to scroll down using the down arrow with the mouse it just closes the list.
Strange; I see this problem in Google Chrome only - will try to debug.
gostar wrote: I now also have another problem is i copied the js file and the html page to my other website www.otmcapital.com/newsearchbox.php and it does not work at all. it does not seem to like accessing the XML feed from a remote site on a remote sever, any ideas on this would be perfect as i need to install the search box on around 2000 websites
Cross-site AJAX is prohibited by all modern browsers; this is a security measure that shouldn't be circumvented (unless you have a AJAX proxy on your server).
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi Dimitriy
Thanks for this much appreciated
I understand the situation with the xjax proxy. The problem I have is that having 2000 websites that want the new search box for our products i cannot guarrantee that they have PHP installed and therefore the outa.php file might not work. Also it means that they have to install addiitonal files where as at the moment its a simple script to add the searchbox
So do you have any ideas on a work around.Perhaps you might know of a javascript that would allow me to show the search box on any website but in actual fact its running form my server so therfore the outa.php file can operate always on my server
I do appreciate your help
John
|
|
|
|
|
In your example you show how to define a key/value pair array but I am unable to access the "value" portion by using either "actb_selectedIndex" or "actb_pos" to find the index. The "actb_selectedIndex" property seems to return "-1" all of the time while the "actb_pos" property seems to return the position in the drop-down list (not in the array). Ultimately my goal is to set a hidden field to the "value" portion of the chosen item in the array when the value in the auto-suggest text box changes.
<head>
<script type="text/javascript" src="autosuggest.js"></script>
<script>
var customarray =
new Array(['apple', 1], ['alligator', 2], ['banana', 3],
['elephant', 4], ['pear', 5], ['kingbird', 6],
['kingbolt', 7], ['kingcraft', 8],
['kingcup', 9], ['kingdom', 10], ['kingfisher', 11]);
</script>
</head>
<body>
<input type="text" onchange="HiddenField.value = actb.actb_selectedIndex;" />
</body>
|
|
|
|
|
Hi Ben,
please use the following code to receive the index of currently selected item:
for(var i=0,c=0,len=actb_obj.actb_keywords.length; i<len;>{
if(actb_obj.actb_bool[i]) c++;
if(c == pos)
{
return (actb_obj.actb_values[i][1] || 'n/a')
}
}
where actb_obj is the actb object
Regards,
Dmitry.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Thanx for the article and code ...it is really gr8...
BTW i'm added this code in my project but i'm not getting the image if i set actb_useScroll=false.I have kept the image in the same folder as the script.
|
|
|
|
|
Hi - experiencing a problem with the location of the autosuggest div.
When using the code on a page that has a scrollbar, if you slightly scroll down the parent page, and then try to use the autosuggest, the div does not appear under the appropriate text box - sometimes it's over the text box completely so you can't continue typing in your query.
Any help would be appreciated.
|
|
|
|
|
Hi Andrew,
can you please send me the test page where I can see this problem?
Thank you in advance,
Dmitry.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi does any body know how to change the font color from black to white when moving over the list....I have customized the code and applied the hcolor to purple so now the characters in side cannot be seen...so when i move over the options the color of the character should change to white for visibility...if any one has idea plz reply ....its very very urgent....
Thanks in advance
Ashu
|
|
|
|
|
Hi ,
Thanks for your control, i have a problem in using ur control im using the beta control , when im selecting a name from the drop down list for the first time it's working fine , from the second time on when try to select the name from the drop down list using mouse when ever i presses mouse button , the dropdown is closing without completing the operation , the dropdown list is closing in mouse down event , it's working fine in IE7.
Thanks in advance!!!!!!!!
|
|
|
|
|
Good evening,
can you please give a little more info:
- does the bundled sample work ok for you?
- do you use client-side array or a web-service?
- what version of FF you're using?
Regards,
Dmitry.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|