|
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).
|
|
|
|
|
Thanks for your Reply
Ya , it's working fine in IE7 ,
i need to test my application in firefox 2 also , it's giving problem in firefox2 , i didn't checked in firefox 3.
im using client side array only!!!!
Regards,
PV
modified on Monday, September 8, 2008 12:49 AM
|
|
|
|
|
Dmitry, first at all, excelent piece of code, it works smoothly, you're a lifesaver. I have a similar issue in FF3 and Safari 3.1: it´s not possible to select an item by clicking on it (even from the first time in my case). This is the code I have:
<br />
<div id="lyrFastSearch" style="width:250px; height:100px; background-color:White; border:solid 1px blue; padding-right:3px; padding-left:5px; padding-top:5px; padding-bottom:5px; position:absolute; left:20px; top:20px" ><br />
<div style="width:100%; color:Blue; cursor:move; text-align:right; font-size:9px;"><div style="cursor:hand; cursor:pointer; text-align:right; margin-right:0px; width:35px;" onclick="$('tb').value = ''; ">Close</div></div><br />
<font style="font-size:9px">Tip: Start typing to see options.</font><br />
<input type="text" id="tb" value="" style="font-family:verdana;width:96%; padding-right:3px; font-size:12px" rel="" /><br />
<script type="text/javascript"> new autosuggest("tb", namesList, null, function(index, control) { AddSelectedToCaller($('tb').attributes.rel.value, control.keywords[index], control.values[index]); }); </script><br />
</div>
The AddSelectedToCaller function take the selected item and place it inside a sortable list container (and it only works by using the keyboard arrows)
Thanks in advance.
"Master Control Program: Your user can't help you now, my little program! " (Tron, 1982)
|
|
|
|
|
Hi,
1. Did you try the latest release of the script?
2. After mouse selection fails - are there any errors shown in Firefox's error console?
3. Is the page in question on the net so I can look at it? If it is not for public - can you please send the URL to my e-mail (dmitrykhudorozhkov@yahoo.com)?
Regards,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi Dmitry. Thanks for your time on this.
1. Yes, I did.
2. No error is shown in FF error console
3. Ouch!.. Sorry, by this time, this is an internal development (as an extreme measure, I´ll find out the way to publish it).
I found that the function AddSelectedToCaller as defined in new autosuggest("tb", namesList, null, function(index, control) { AddSelectedToCaller($('tb').attributes.rel.value, control.keywords[index], control.values[index]); }); is not being called (as mentioned, it is called only when keyboard is used)
Also, I´m using $('tb').attributes.rel.value to have a reference to the control which required to show, with particular info, the autosuggest (of course, before of this, I set the 'rel' value of the 'tb' control).
By the way, the JS parameters I´m using are:
this.time_out = 0; <br />
this.response_time = 100; <br />
this.entry_limit = 10; <br />
<br />
this.limit_start = false; <br />
this.match_first = true; <br />
this.restrict_typing = true; <br />
this.full_refresh = false; <br />
<br />
this.use_iframe = true; <br />
this.use_scroll = true; <br />
this.use_mouse = true; <br />
this.no_default = true; <br />
this.start_check = 0; <br />
<br />
this.text_delimiter = [";", ","]; <br />
this.ajax_delimiter = "|"; <br />
this.item_delimiter = ","; <br />
this.selectedIndex = -1;<br />
and finally, I´m using a Javascript array to load the options, for example:
var namesList = [['Bruce Dickinson', '245|1'],['Adrian Smith', '246|1']] (Yes, the identifiers need to come in the 'X|Y' format and yes, it´s loaded via asp.net in runtime)
Well, I hope this information can be enough for you.
Thanks again and regards.
"Master Control Program: Your user can't help you now, my little program! " (Tron, 1982)
|
|
|
|
|
Sorry to keep bothering you..
When using an external script to generate XML data for the data population, your article states that the required format is:
<listdata>item1,value1|item2,value2|...what if the item or value has a comma in it?
I replaced all commas with their ascii equivelant (,), which works fine when displaying the suggest list, but once one is selected and moved to the text box, the ascii value is shown, so that's no good.
Any suggestions?
|
|
|
|
|