By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,247 Members | 1,427 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,247 IT Pros & Developers. It's quick & easy.

onKeyup - cancel previous events if next char entered quickly?

P: n/a
I use the js onKeyup event to trigger server side db searches in a
hidden iframe page and generate a list of selectable items in the
parent page. The minimum characters to initiate a search is 3. I'm
trying to minimize the number of unnecessary db calls as much as I
can. It seems like if I type in 6 characters real fast then there's
only one db call after the last keyup, which is good .. but I'm not
sure. Maybe the previous calls for the 3rd,4th,5th do occur but
quickly cancelled/overridden by the next call. I'm looking for a way,
say, not to call the search after the 3rd keyup if the 4th,5th,.. are
entered real quick. Any ideas? Thanks.
Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
te***@yahoo.com wrote:
I use the js onKeyup event to trigger server side db searches in a
hidden iframe page and generate a list of selectable items in the
parent page.


Do not do that. It is error-prone and we do not have to discuss
the traffic and server load you create with this. Use the change
event or the click event of a button instead.

You could instead also retrieve the list once (when loading the
document) and store the database data in a client-side object,
then use only that object which would mean a considerable decrease
of network traffic and server load.
PointedEars
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.