|
Hi Dmitry !
Glad to see that you continue to support your "child", and it justly became very popular.
Nevertheless two notes.
One - minor bug: the name of the variable use_IFrame is used with different case, so it always works as false.
Second - suggestion. May be it has sense to add to the autosuggest object one more property - id. Say, this.id=this.field_id + '_actd' . It may be useful when you have several autosuggest objects and want to use the single OnSelect function.
Regards,
Gennady
My English is permanently under construction. Be patient !!
|
|
|
|
|
Forgot one more suggestion, that as far as I remember, I've already suggested in the past.
So the thead may be called "Three things"
I'm speaking about styling. It would be much more convenient,
if the suggestions style will be in the external css.
And leave the default style inline.
Regards,
Gennady
My English is permanently under construction. Be patient !!
|
|
|
|
|
Good evening,
On your notes:
1. Thank you for pointing on the use_IFrame - will fix it in next release (next week).
2. You can use a single OnSelect now too - just define it as a separate named function:
function onSelect(control, index)
{
...
}
and use it wil any number of autosuggest objects:
new autosuggest("field1", custom_array_2, null, onSelect);
new autosuggest("field2", custom_array_2, null, onSelect);
...
If you still need to access the autosuggest object, you can do it through the input field it is bound to:
document.getElementById("field1").autosuggest
3. CSS for styles is high on my work list - will be done for the next release.
Best regards,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi Dmitry!
Think, I didn't explain clear enough my question concerning control ID. It is needed not to get access to the control, but in the first place - to recognize control. For instance:
function ItemSelected(index, control) {
switch (control.id)
{
case 'BRANCH_CODE_ACTB':
CleanDependentDDL('ROVA_CODE_ACTB');
<......>
return;
break;
case 'ROVA_CODE_ACTB':
CleanDependentDDL('AREA_CODE_ACTB');
<......>
return;
break;
}
}
I know that I can use control.field_id property, but to consistency and readability of the program it would be better not to use "indirection".
Regards,
Gennady
My English is permanently under construction. Be patient !!
|
|
|
|
|
Hi Dmitry,
Testing the "restrict list" feature I noticed that if I typed certain characters (2nd Letter) that were not part of the word in the list, then the list disappeared. For instance if my list contained "apple", and I type "a", "apple" would appear. If I then type "s" then the restrict is somehow bypassed and "apple" disappears. It only does it with some letters - and changes depending on what word is in the list. It also does it whether the 2nd letter type is not in the entire word or another word in the list. Strange? IE and chrome.
Regards
Collin
Ok did some more checking if the JS script is set to "autocomplete to beginning of word", the restrict script does not take this into account. It will only restrict typing based on what is in the entire array. That is why you can type a second letter even if does not appear in the list because that letter combination might appear elsewhere in the array.
modified on Saturday, August 15, 2009 7:45 PM
|
|
|
|
|
Hi,
seems like a bug; I'll try to take care of it till the next release (early next week, I hope).
Regards,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi Dmitry,
Thanks for all your hard work on improving the code.
Just a question for some thought.
I have an array which is produced from a DB. I have managed to incorporate this autosuggest quite well and was wondering if there are any limitations in the code for the length or size of the array.
For instance when I create an array from my DB recordset the autosuggest seems to stop working after 117 comma separated array. I can echo the entire array onto the page so its not a server side issue. It (autosuggest)just seems to stop after a certain length.
Regards
Collin
|
|
|
|
|
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
|
|
|
|