|
This control uses HTML-level INPUT control to link to; so there is nothing stopping you from using it anywhere where you can digg INPUTs. Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Thanks a lot for the reply.
I am trying to add the control into one of my gridview. For the first row, it is working but for the second the suggestion list is not coming at all.. Please help me to find a solution.
The control is inside the EditItemTemplate of gridview.
|
|
|
|
|
by generating dynammic id for the control will do the trick. But as my gridview have scrollbar in it, I am having problems with the positioning of suggestion box !
|
|
|
|
|
Solved. Modified the function curPos, included object's scrollTop. modified on Sunday, February 14, 2010 8:04 PM
modified on Thursday, February 18, 2010 12:17 AM
|
|
|
|
|
Hello,
When I select one item with click has a bug and mouseClick don't show my selected item... Do you know about that?
thanks!!!!
|
|
|
|
|
Hi,
can you please give more info on this. Are there any errors in erroк console (if you open in Firefox)? Does the original script work ok for you?
Regards,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi
I am using autosuggest.js and i have called the new autosuggest(,,,,) onkeypress of my textbox.
But the drop-down is shown in the second case only. Or if i provide any event(alert or something like that) it comes.
Would you please help out with your solution
Thank You
Joanna
|
|
|
|
|
Hi
In autosuggest.js, the first taken array values are not changed after getting new array.
I have removed the code if(exists)return exists...then it works....but the drop down values are not alloewd to select via keypress then.
please help with ur suggestions
Thank you
Vineetha
|
|
|
|
|
Hi
Firstly, amazing script, no issues implementing it. Just one shortcoming on my end.
I was trying to fetch data from a separate file(eg. data.php), used like
<input type="text" id="tb2" value="" />
<script type="text/javascript">
new autosuggest("tb2", "", "data.php?", function(index, control) {
window.location=("" + control.values[index] + "");
});
</script>
In this data.php, i created the node <listdata></listdata> with each val1,key1 delimited by |. Now, when i used your script to fetch data from this file, it became very slow, taking almost 10 seconds to bring up the suggestion.
I am sure, something I am doing is not correct. Could you please help here. I'd like to mention that file is holding some 1000+ records.
Also, i'm no pro, just working on the first project.
Thanks in advance
P.S.--> I tried hard coding the array in autosuggest.js file (the file size reached 191kb) the script worked fine. normal speed. But I don't think its the right way to do it. because the array needs to be updated everytime data changes in database table
modified on Monday, December 28, 2009 5:07 PM
|
|
|
|
|
This is a super script! Thank you for it!
Question: How can I change the script to use a word like " and " (incl. interspaces) as delimiter?
Small bug: when you use Backspace and the number of characters becomes < this.start_check, the suggestion list should hide.
|
|
|
|
|
herbert7 wrote: This is a super script! Thank you for it!
You're welcome
herbert7 wrote: Question: How can I change the script to use a word like " and " (incl. interspaces) as delimiter?
this.text_delimiter = ["\""];
(notice the backslash before the 2nd quote)
herbert7 wrote: Small bug: when you use Backspace and the number of characters becomes < this.start_check, the suggestion list should hide.
Thank you for noting this.
Regards,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Dmitry Khudorozhkov wrote: this.text_delimiter = ["\""];
(notice the backslash before the 2nd quote)
Sorry, I mean something like:
this.text_delimiter = [" and "];
This doesn't work properly. In this case there are no suggestions given when an input contains a character a.
I think now a delimeter can only be a single character and not a string.
People give frequently inputs like "apple and pear".
I'd like to make this function more intuitive by the string " and " acting as delimiter.
Regards, Herbert
|
|
|
|
|
I have a dinamic client-side array, so each time the list is updated, I created an autosuggest control like this
var autosCalles = new autosuggest('calle',arrayCalles,...)
Using autosuggest 2.3 this worked OK, but after changing to autosuggest 2.4, the list did not update after first load.
Reading the page I discovered the new bindArray() function, so I added autosCalles.bindArray(arrayCalles) after creating the control, and the list updated OK, this works fine now...
not sure but... Is it maybe loading the list twice? first at new autosuggest() and then at bindArray()?
Regards
|
|
|
|
|
I'm getting lots of js-warnings of undefined "window.opera"...
Advertencia: reference to undefined property window.opera
Archivo de origen: http://[...]/autosuggest.js
Línea: 1365
Advertencia: reference to undefined property window.opera
Archivo de origen: http://[...]/autosuggest.js
Línea: 195
...and also "window.event":
Advertencia: reference to undefined property window.event
Archivo de origen: http://[...]/autosuggest.js
Línea: 891
Advertencia: reference to undefined property window.event
Archivo de origen: http://[...]/autosuggest.js
Línea: 209
Using FF3
Using autosuggest 2.4
Using XHTML 1.0 Transitional
Regards
modified on Friday, November 20, 2009 7:02 AM
|
|
|
|
|
Dmitry
In the page, under Options, it says
"If you wish to use up/down arrows instead of a scrollbar in this control..."
I think it should be more specific in order not to confuse with the up/down KEYS.
I was reading it, and I had an issue working with the keyboard and I thougth this was related... it took me a while realizing you meant the up/down arrows scroll-control instead of the up/down keys.
Regards
modified on Friday, November 20, 2009 6:59 AM
|
|
|
|
|
First of all, nice work! I have a question though. This does not seem to work if I am generating a text box dynamically and append the autosuggestion script with it. Specifically, the html code below added a text box each time you click the add button, but that text box cannot auto suggest even though I generated the autosuggest script with the new text box. Any suggestions?
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="autosuggest.css"></link>
<script type="text/javascript" src="autosuggest.js"></script>
<script type="text/javascript">
var custom_array = ['audi', 'abentley','abuick', 'achevrolet', 'achrysler', 'adodge', 'aford', 'agm',
'ahonda', 'ahyundai', 'aisuzu', 'ajeep', 'akia', 'alamborghini', 'amazda', 'nissan',
'aopel', 'apontiac', 'arenault', 'asaab', 'atoyota', 'avolkswagen'];
</script>
<script language="javascript">
fields = 1;
function addInput() {
var htmlText = "<input type='text' value='' id='field"+fields+"' name='field"+fields+"' />" + "<script type='text/javascript'> new autosuggest('field"+fields+"', custom_array); </scr"+"ipt>"+"<br />";
var newElement = document.createElement('div');
newElement.id = 'SomeID';
newElement.innerHTML = htmlText;
var fieldsArea = document.getElementById('text1');
fieldsArea.appendChild(newElement);
document.getElementById("field"+fields).focus();
fields += 1;
}
</script>
</head>
<body>
<form name="orderform" action="Order.jsp" method="get">
<input type="text" name="field0"/><script type='text/javascript'> new autosuggest('field0', custom_array); </script>
<input type="button" onclick="addInput()" name="add" value="Add input field" />
<div id="text1">
</div>
<br />
<input type="submit" value="Submit" />
</form>
</body>
</html>
|
|
|
|
|
Hi,
Your code works for me in Firefox, but not in IE, Opera or Chrome - the latter 3 can't find the newly created input box. This probably has something to do with the timing of DOM operations.
I'll try to tackle this problem shortly.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Found the solution: you need to call the "new autosuggest" directly, not through the creation of script element.
var fields = 1;
function addInput()
{
var input = document.createElement("input");
input.type = "text";
input.id = "field" + (++fields);
input.name = "field" + fields;
var fieldsArea = document.getElementById('text1');
fieldsArea.appendChild(input);
new autosuggest("field" + fields, custom_array);
input.focus();
}
- this works for me in Firefox 3.6, Opera 10, Chrome 3 and IE 7.
Hope it helps,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Hi,
As I said previously, I am trying to reproduce the autosuggest control of Google Code.
A screenshot of what I manage to do:
http://img252.imageshack.us/img252/6416/autosuggest.png
But I am still struggling to remove space between suggestions.
Whatever I do in CSS does not change that, so I assume the issue lies in the JavaScript code. I am still a newbie in JS.
Any idea?
Thanks.
|
|
|
|
|
But I am still struggling to remove space between suggestions.
The solution was actually simple: there was a line-height property for table cells in another CSS file.
|
|
|
|
|
Great control!
I have been trying to implement a variable which will tell me if the user has selected an item, or if the text typed is not in the list.
How should this be done? I have of course tried with the selectedIndex, but once a user first has chosen an item and afterwards changed the text to something not in the list, the selectedIndex still remembers the last selected item.
any ideas?
|
|
|
|
|
Hi,
KGiil wrote: I have of course tried with the selectedIndex, but once a user first has chosen an item and afterwards changed the text to something not in the list, the selectedIndex still remembers the last selected item.
This is a bug, of course - I'll try to find a solution shortly (in a few hours).
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Please try the following. Find the code at the end of the suggest method:
if(this.total)
{
this.startTimer(0);
this.build();
}
else this.hide();
Change it to:
if(this.total)
{
this.startTimer(0);
this.build();
}
else
{
this.selectedIndex = -1;
this.hide();
}
This should fix the problem - selectedIndex will be -1 when no variants are available.
Hope it helps,
Dmitriy.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
Another solution: you could simply check the variable total of autosuggest object - it holds the # of available suggestions to the typed keyword. If it is 0 - the typed text is not in the list.
Listen up! "Teamwork" means staying out of my way! (Seifer, Final Fantasy 8).
|
|
|
|
|
How is this done?
Can you provide an example for checking the total and/or selectedIndex variables?
Thanks
|
|
|
|
|