I've got auto-suggest working perfectly. It's great. I can use multiple text fields without any problems, except when I put the field within a form.
This is test code that works for the built-in array and for server side auto-suggest. Works perfectly in both cases.
When I had this working, I'd thought that I would have no problems getting this into real code.
var customarray = ["apple", "alligator", "banana", "elephant",
"pear", "kingbird", "kingbolt", "kingcraft",
"kingcup", "kingdom", "kingfisher" ];
var obj = new autosuggest("tb", customarray);
var obj = new autosuggest("tb2", "", "http://127.0.0.1/autosuggest.wsgi/?field=npi&s=");
For whatever reason, auto-suggest is not reading in the strings from the fields when it's in a form.
It would be good to be able to give the id of the destination of selected value as an argument.
current code already has the callback function - it's very task is to allow you to do whatever you want to do. You can just get the field from inside the callback and assign it's value to the selected one, voila
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
I have a couple of questions regarding the ajax call
1, can the url have parameters? I would like to call a perl script and pass 2 parameters to it like year and model. 2, why do you need the question mark at the end of the url string?
here is what I would like to use
var line = 'FieldId'; var url = "vin.pl?Year="+year+"&Model="+model; asbbox[line] = new autosuggest(line, '', url);
Thanks for your help with this. The autosuggest version I am using is 2.3.
I know this is an old post, but I got parameters to work correctly by putting a "&" the end of my ajax url (ie, after my last argument). The code appends an additional argument to the url. That is why you have to have the '?' at a minimum at the end.