473,672 Members | 2,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

onKeyup - cancel previous events if next char entered quickly?

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
1 4735
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2136
by: allyn44 | last post by:
HI--what I am trying to do is 2 things: 1. Open a form in either data entry mode or edit mode depending on what task the user is performing 2. Cancel events tied to fields on the form if I am in edit mode. The reason I want to do this is becasue when entering a new record the form is entered in data entry mode and I have lots of stuff happening upon entering and leaving fields. In edit mode I do not want the events to fire.
2
5872
by: Stephen | last post by:
I have code which checks whether a datagrid is empty and if it is it shows a panel on my page. If its not empty then Im using the server.transfer to go to another page so as im able to use the items in an array list. My problem is that I also have had to incorporate some Javascript to see whether the user is ok with moving forward. Everything is fine and works apart from when the user clicks cancel on the pop-up Internet Explorer window it...
1
4268
by: David Smith | last post by:
What I want to be able to do: A textbox is available that the user can enter information into. Specifically (for the purposes of this post), the user is asked to enter a number, and that number has an upper limit. I want to do validation on what the user enters as they type it in. I set up an event handler for KeyPress that restricts them from being able to enter non-numeric characters (only allowing numbers, decimal point, control...
3
2404
by: MB | last post by:
Hi, I am doing a project which uses asp.net to develop its forms. The form uses validation web controls to validate the data entered in text boxes. When Cancel Button is pressed which is to exit from the current page and go to the previous page, the validation controls activate because data has not been entered, and the user cannot cancel. I have used Response.Redirect(webpage) but the validations activates and unless I enter some data...
14
2620
by: clintonG | last post by:
This is an appeal for peer support sent to Microsoft as will be noted in closing. The Login control does not include a Cancel button. The only option is to convert the Login control to a template which is not such a bad thing in itself but it means all other controls in the application must also be converted to templates to maintain a consistent UI. So much for writing 70% less code when foolish morons release a control with no cancel...
8
2814
by: paul.sherwood | last post by:
Hi Ive made a game for babies that simply displays one of an array of pictures of animals along with there sound each time the keyboard is 'bashed'. at the moment i dynamically load pictures using <img id="image" src="somepic.gif" alt="" border=0px/> <script type="text/javascript">
2
2902
by: john.lum | last post by:
My overall objective is to create something akin to Google Suggest, where a query is done in response to changes in a text field presented to the user. I've got things working using the onkeyup event and some AJAX techniques, but I am troubled by one thing: the more characters that are entered, the slower the interface is to settle down, because a discrete lookup is done each time the field changes by a single character.
3
4035
by: Brad | last post by:
The first text on my form is a numeric field. I have a javascript that runs on this field for onkeyup (validate the key strokes and modifies fields on the screen) but when I do this and have the autopostback on, the autopostback does not trigger. The autopostback will trigger if I hit the enter key while in the textbox but not when I leave focus. Here is the code for the textbox. <asp:textbox class="required" AutoPostBack="True"...
13
3915
by: alvinwoon | last post by:
URL: http://events.unl.edu/ Description: i coded a quick and dirty key navigation for the calendar. if you press left arrow on your keyboard, it will navigate to the previous date and fire an ajax request to grab the content. Vice versa for right arrow key. Problem: the problem is when you multi-tap the arrow key a few times consecutively (4/5 of my testers do that to quickly get to the specific date they want), the ajax request call...
0
8423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8947
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7479
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6261
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4245
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4442
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2097
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1842
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.