|
Is there a script based solution to disable the browser autocomplete (because the menu with suggestions opens behind the browser autocomplete)?
Edi
|
|
|
|
|
Sorry for the dumb question... I found the solution by myself and added autocomplete="off" to the form-tag.
Edi
|
|
|
|
|
HI
I am using your code for autosuggest functionality, and its been fantastic. Though there is small request, I have to add a down key functionallity so that even when the textbox is empty the user can see the entire list with a downKey press. Could you provide a patch or suggest the modifications needed for the successful implementation of the above mentioned feature.
Regards
Ayush
|
|
|
|
|
Hi!
To show the whole list using a special sign (e.g. "?") you only have to add one line and to change an other line in autosuggest.js.
Within "function actb(id, ca, url)"
define the new public variable
this.actb_show_all = '?'; // show widget with the whole list when '?' is typed in.
Look for the line "done: function(ot, t)"
(this should be line 1104 or nearby)
and some lines later (line 1118) change the statement
if(re.test(this.actb_keywords[i]))
to
if((re.test(this.actb_keywords[i])) || ot == this.actb_show_all)
If you enter the sign you defined in the variable this.actb_show_all
(here '?') in your input field the whole list will be shown.
You may choose any suitable sign not used within the list itself (e.g. '*' instead of '?') for the variable this.actb_show_all to indicate, that the whole list should be displayed.
Good luck!
|
|
|
|
|
Thank you for this component.
Please include version/date in your source files. You are mentioning new versions as of october 30th, but it's unclear whether you actually posted this new version.
Bugs I've found:
When actb_firstText=false, and you type 'au', audi is being shown, when appending the 'd', the suggestion box highlights 'audi'. So if you actually want to search for the term "aud" and you type it slowly and press enter, you will be searching for "audi".
Regards
|
|
|
|
|
I think the date in the top right corner will change when this page is updated. Doesn't necessarily mean a version change, but it will give you some idea. A version number in the file is still a good idea.
Posted: 24 Aug 2007
Updated: 11 Oct 2007 <--- This
Views: 22,538
|
|
|
|
|
Thanks
yeah or the changelog date, but I just wasn't sure so ended up checking the filedates in the zip file. regards
|
|
|
|
|
Hi Dmitry,
I was looking for some auto complete tool on the web and came across your tool. It is the best ever available and it matches with the requirement what we have right now. But, there is a single problem when it comes to SELECT boxes. The suggestion control is rendered behind these SELECT boxes. I saw there is one variable this.actb_useIFrame, setting this to true should have fixed the problem, but not in my case. I dont know why is it a bug in the way I am implementing it or there is some more configuration/code changes are required.
I would appreciate if you can look into this and let me know.
Attached is the screen shot for your reference and also attaching the autosuggest.js file for the reference where the value of this.actb_userIFrame is set to true.
I am using Internet Explorer 6.
Thanks a ton in advance.
I sent you the mail also with the attachment on your email address posted on the website.
Regards,
Ravi.
|
|
|
|
|
That's quite strange that this problem surfaced again; can you please e-mail me a sample HTML that shows the problem?
- Dmitry.
P.S. I've just re-checked; actb_useIFrame option works ok for me. Waiting for your e-mail.
P.P.S. I still haven't got your e-mail; please re-sent it to: dmitrykhudorozhkov@yahoo.com
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Problem was solved; it seems that I've finally found a all-around solution to the problem. The fix wil be included in the next release of the script (Oct. 30th).
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Next update will bring fixes to some small but annoying bugs, and (probably, not yet decided) a PHP, ASP.NET and Ruby-on-Rails sample web services for you to test the script.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Thats great ....Waiting for 30th October
|
|
|
|
|
Hi,
Thanks for great control. This is very useful to me. I had a few questions... I need to show a simple error message if user input doesn't match with source. I'm giving a link to the server-side script to get the list(aspx page).Is it possible to show simple error message and call another URL for loading source. Please look into this and let me know the possibilites. It will be very helpful to me. Thanks in advance.
Priyatam
|
|
|
|
|
Not sure I understood what you exactly want, but:
1. Take a look at actb_penter method. There you should perform your comparison and alert the user of wrong input.
2. You can change the server URL anytime through the actb_suggesturl variable of the actb object.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Thanks for the quick reply
I'm sorry that you didn't get what I said....lemme explain it clearly.
I have two types of lists....Generic lists and non-generic lists. Be default,I'm giving the server URL which returns Generic lists and so when user types, generic list values are shown up.
For ex: adam,eve,may are values in generic list. If user types "z" which doesn't match with current array...I have to show a error message...something like..."sorry,we dont have that name please select a value from the following list" and then call another server URL which returns non-generic list of values...so that I can show non-generic list values as suggestions.
Hope this is clear.... Your help is much needed.... thanks in advance
|
|
|
|
|
Now I got it.
You should check if the first URL returned any match at the very beginning of the done method. You should add:
done: function(ot, t)
{
if(ot.length < this.actb_startcheck) return;
if(!this.actb_keywords.length)
{
alert("sorry,we dont have that name please select a value from the following list");
this.actb_suggesturl = "new.server.com";
this.actb_tocomplete(0);
}
... Hope it helps,
- Dmitry.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Thanks for the reply. It was really helpful. I was able to throw error message when input doesn't match with source. After that I'm giving new server URL again (for generic list), but it does not call this new URL. Simply throws "sorry,we dont...." message and nothing appears in the list.
And I'm not able to show error message and call new URL if user input mismatches after typing 2 or more letters. I set "actb_fullRefresh" to true and then I'm able to show error message and call new URL(though request is not sent to page . Is this recommended or is there any alternative.
Awaiting your help on this. I'm almost there in filling my requirement
|
|
|
|
|
Using "fullRefresh" option is ok for you, but:
1. My mistake; instead of:
done: function(ot, t)
{
if(ot.length < this.actb_startcheck) return;
if(!this.actb_keywords.length)
{
alert("sorry,we dont have that name please select a value from the following list");
this.actb_suggesturl = "new.server.com";
this.actb_tocomplete(0);
}
... Type:
done: function(ot, t)
{
if(ot.length < this.actb_startcheck) return;
if(!this.actb_keywords.length)
{
alert("sorry,we dont have that name please select a value from the following list");
this.actb_suggesturl = "new.server.com";
this.actb_toid = 1;
this.actb_tocomplete(0);
}
...
2. script always send only the first letter of the typed text to the server-side service; to change it, look at the line (actb_tocomplete method):
var ot_ = ((ot.length > 1) && !this.actb_fullRefresh) ? ot.substr(0, 1) : ot;
This might also be helpful to you.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi,
I tried to add the above lines. I was able to show error and call another server URL if user input does not match with non-generic name list. Also I was able to retrieve all the generic names from server-side service. ...Thanks for your help
But, when I clear all the text and type a letter, the code again calls new server URL instead of the default URL we have given. My requirement is to call new server URL only if input does not match,but not all the time. Can you please help me in doing this.... Thanks in advance
|
|
|
|
|
Priyatam K wrote: But, when I clear all the text and type a letter, the code again calls new server URL instead of the default URL we have given. My requirement is to call new server URL only if input does not match,but not all the time. Can you please help me in doing this.... Thanks in advance
You should check (at the beginning of the actb_checkkey method) if the input field contains any text (obj.actb_curr.value ), and if not - assign this.actb_suggesturl back to old URL.
Hope it helps,
- Dmitry.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Perfect..... Thanks for all your help Dmitry. My requirement is fullfilled. Now I have to fit this in my project. Hope everything goes well. Thanks again and Wish you all the best
Priyatam K
|
|
|
|
|
Hi Dmitry,
Just found a small bug in positioning suggestions div. I was creating a textbox dynamically and adding it to a panel (C#). After generating the control, if I scroll down the page and then type in the textbox, suggestions position is being displayed from actual top position(top positoin before scrolling). I have used the following function to get top and left positions.... and it works fine now.
function findPos(obj) {
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
Thanks,
Priyatam
|
|
|
|
|
Hi Dimitry,
I had the immediate need of some additional fixes/features:
- Ability to display the list programmatically from outside code, e.g. a combo box dropdown button
- In addition to matching at beginning of string, also support matching at begging of words in the string
- If the minimum number of characters is 0, the list should be allowed to display when the text is blank, and should display all items (up to the specified max)
- The list gets re-ordered each time it is searched
- Issue with tabbing out of control when no item is selected
- Other minor issues with the list not showing or hiding consistently in different browsers
- Desire for more developer-friendly names for the “public” properties (e.g. the “actb_” prefix is unnecessary)
- zichun's original code was needlessly complex
Partly to address these issues and partly to make the code easier to understand so that I could more easily tweak the behavior, I have largely re-worked it. If you're interested I can send you the code. The downside to my changes for existing users is that I have changed the property names to make them clearer, so existing code would need to be modified to work with my changes.
Just thought I would let you know, and keep up the good work. I have voted for your article already!
Greg Bahns
-- modified at 1:18 Thursday 11th October, 2007
|
|
|
|
|
Hi Greg,
I'd be very grateful if you send your modification to me. All your changes look sweet
Thanks a lot,
Dmitry.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi all!
Auto-suggest control is close to it's maturity, and I'm thinking (supported by multiple requests) to create an ASP.NET control out of this code. I'll also publish a webservice code (probably, as a separate article), that can be used with it.
What I'm asking is your advice. What features do you need? What should I add/omit/be aware of? I'm not so proficient in ASP.NET (I'm learning it intensively now), so I hope you'll give me some guidelines
Best regards & thank you for your support,
- Dmitry.
P.S. the updated article and code were sent to CP yesterday - a bit overdue, sorry. It will be available in a day or so.
-------------------------
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|