|
Good morning,
there is no limitation on the length of the client-side array; I have successfully tested the script with arrays with 6000 (six thousand) records and it worked ok.
Problems usually arise because of incorrect escaping (any quotes in the records?). If something stops working - are there any errors shown in Firefox's error console?
Best regards,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Dmitry,
Thanks for the reply,
After investigating the record data in the array I did find traces of characters that corrupt the string. The only ones that corrupt the array were (single quotation) ' and \ (back slash). Surprisingly a comma , or double quotation " had no effect.
This would probably mean I need to cleanse my data on data entry.?
Regards
Collin
|
|
|
|
|
kernel1969 wrote: This would probably mean I need to cleanse my data on data entry.?
Maybe (or maybe not). All this means that in the end (when you output the array to the page) you must output the correct Javascript array. It doesn't matter if you clean the data at the data entry or escape/cleanse it when building output.
Hope it helps,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
|
Hi,
I have 3 autosuggest textboxs:
text1,text2,text3.
I need that if text1 or text2 was populated then text3 is enabled
and if both of them was erased text3 will be disable again.
I have tried the following code:
Event.observe('locationText', 'onkeydown', onKeyDownPress);
Event.observe('britText', 'onkeydown', onKeyDownPress);
function onKeyDownPress(event) {
var element = event.element();
var textLength = element.value.length;
if (textLength == 0) {
byLocationFlag = 0;
$('KMText').disabled = "disabled";
}
if (textLength > 0) {
byLocationFlag = 1;
$('KMText').disabled = '';
}
}
but when I select by going down on the list (with keyboard arrows) the event is not happenning.
what I did wrong?
|
|
|
|
|
hi When i am using this code only pre defined data is showing. I want to use asp textbox as input and array from my database. How can i do this.
waiting for your ans.
thanks
|
|
|
|
|
I get my suggestion list ok but I don't have the arrows up and down.
If you have an idea why it is happening.
Tali
|
|
|
|
|
Hi,
if you don't have the arrows - then you should have the scrollbar, I guess.
The mode (scrollbar or arrows) is controlled by use_scroll member variable of autosuggest object.
Regards,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi Dmitry
I also have this problem.
With use_scroll = false;
The up/down arrows are nolonger displayed ?
was okay when using prev. version with CSS built in and not external.
Regards
Phil
|
|
|
|
|
|
I've been e-mailed about this issue recently; this is somehow related to inner sorting.
I'm just back from the vacation - will try to sort out the issues by weekend.
- Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
This will be fixed in the next release. The fix is:
1. Find the code:
suggest: function(ot, t)
{
if(ot.length < this.start_check) return;
var al = this.keywords.length;
this.total = 0, this.rebuild = false;
if(!this.field.value.length)
{
this.total = al;
for(var i = 0; i < al; i++)
{
this.keywords[i] = this.keywords_init[i];
this.values[i] = this.values_init[i];
this.bool[i] = true;
}
}
...
Change it to:
suggest: function(ot, t)
{
if(ot.length < this.start_check) return;
var al = this.keywords.length;
this.total = 0, this.rebuild = false;
for(var i = 0; i < al; i++)
{
this.keywords[i] = this.keywords_init[i];
this.values[i] = this.values_init[i];
this.bool[i] = true;
}
if(!this.field.value.length)
{
this.total = al;
}
...
Regards,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Thanks, I'm using the new version now.
Regards
|
|
|
|
|
1. use_scroll=true, When selecting an element from the list with mouse, it doesn't work: the list closes and the selected value does not appear (FF3).
2. use_scroll=true, When selecting an element from the list with mouse, the first time it does not work (the list closes and the selected value does not appear), second, third and next times it works OK (IE7).
3. use_scroll=true, when clicking in any part of the scroll bar (up/down arrow, grabbable area or empty area), the listbox closes (IE7).
Regards
|
|
|
|
|
Not the best "solution", but these issues seem to disappear with use_scroll=false
I would like to use scroll, since it resembles better a real select (combobox).
|
|
|
|
|
Hi,
have you been able to reproduce these issues with vanilla script (i.e. the original package)? If not, then the problems are not in the autosuggest script but the onSelect callback.
Regards,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
I have an input with autosuggest. I added onblur attribute to the input to trigger some function, and it works ok the first time, but after that first call, it does not work anymore (maybe because autosuggest is also capturing the onBlur event?).
This happens only in IE7 and not in FF3.
If I move the function call from onblur to a button+onclick, it works fine.
How can I correctly trigger my onblur function?
Snippet of code:
<select name="codigo_comuna" id="codigo_comuna" class="combos" onblur="seleccionComuna();" > (this method calls autosuggest)
<input type="text" name="calle" id="calle" class="campos" maxlength="100" onblur="seleccionCalle();" /> (this method also calls other autosuggest)
|
|
|
|
|
Solved using html onchange (for values NOT IN the list) + js function call on autosuggest value select (for values IN the list), instead of onblur:
var myautosuggest = new autosuggest('item',myArray,null, function(index,control)
{
//alert('OK');
myAction();
}
);
< input onchange="myAction();" />
Regards
|
|
|
|
|
Yes, this happens because for IE script sets the "on[Event]" attribute instead of attaching a handler for the event. This will be addressed in the next release.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Let's say I have "apple" in my array and I type "application" into the form. Then the suggestion list stays there with apple, but naturally I want it to disappear. Have I missed editing some config setting, or is it supposed to work this way?
|
|
|
|
|
This will be fixed in the next release.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi,
Does this control work on Firefox 3.0.11?
Because for me it is not working on Firefox 3.0.11
With what version of firefox is it compatible?
Thanks and Regards,
Aasheesh
|
|
|
|
|
Hi,
control does work with all version of Firefox; just checked in 3.0.11 - works.
Did you test the sample from the original archive or your own adoption?
Regards,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi,
I have a need to edit the display in the textbox, when a value from the autosuggest is selected.
For ex., if the string selected is "6202-PP: Product Piping System", then I want only the string "6202" to be displayed.
Can I do this using the onSelect parameter? If so, can you give a code example of how to do this?
Thanks,
Aasheesh
|
|
|
|
|
Hello,
the use of onSelect callback is simple:
new autosuggest("field", customarray, null, function(index, control)
{
alert("You've selected the key: " + control.keywords[index]);
});
function in bold is the onSelect . In your case:
new autosuggest("field", customarray, null, function(index, control)
{
document.getElementById("textbox").value = control.values[index];
});
Hope it helps,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|