I have a search suggest currently working.  Users type in a company
name and the results as they type are returned to a div tag that has a
auto scroll enabled.  This works fine for IE 6, FF 1.5 but not all the
time in IE 7.  If you type slow (a letter every second) it works.  But
if you type in fast (two letters every second) it shows nothing.  I've
checked with Fiddler and the request are being made but the response is
not showing up.

Here is the JS code I am using:


<script language="javascript">

function SearchWord(pressevent,keyValue) {
var charCode = (pressevent.which)? pressevent.which : (event.keyCode);
var SearchBy = document.getElementById("SearchBy").value

// Send to the Server Side Method to get the string

//only characters
//if(charCode >=65 && charCode <=90 || charCode >= 97 && charCode
<=122)
A_Class.Ajax.Search(keyValue, SearchBy, SearchWord_CallBack);
// if the backspace key (8) is pressed and 48 is for the delete button
if(charCode == 8 || charCode == 48) {
// Reset the count
_highlightSuggestionIndex = -2;
A_Class.Ajax.Search(keyValue,SearchBy, SearchWord_CallBack);
}

// when the down arrow key is pressed
else if(charCode == 40) {
if((_highlightSuggestionIndex+2) <=
document.getElementById("Display").childNodes.length)
{
_highlightSuggestionIndex = _highlightSuggestionIndex + 2;
}
Highlight(_highlightSuggestionIndex);
}

// When the up arrow key is pressed
else if(charCode == 38) {
if((_highlightSuggestionIndex-2) >= 0) {
_highlightSuggestionIndex = _highlightSuggestionIndex -2;
}

Highlight(_highlightSuggestionIndex);

}

}

//Receives the Response
function SearchWord_CallBack(response) {
    var word = response.value;
    if(response != null)
    {
    document.getElementById("Display").style.visibility = "visible";
    document.getElementById("Display").innerHTML =
word.substring(0,word.length - 4); 
    }
}


What gives?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info/

Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---

Reply via email to