onkeypress

Javascript onkeypress delete or dot

Is there any way to find out if the user pressed the delete key or dot? It has the same keycode in FireFox. ...

.NET Submit Fires Before Javascript onKeypress

Hello, I am trying to use onkeypress on an input type="text" control to fire off some javascript if the enter button is pressed. It works on most pages, but I also have some pages with custom .NET controls. The problem is that the .NET submit fires before the onkeypress. Does anybody have an insight on how to make onkeypress fire firs...

Avoid Beep sound when enter keypress in a textbox

Hi, When you create an aspx page as this one: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head runat="server"...

Changing the default modal result of a form.showModal

In my Delphi application I have a custom Yes, No, Cancel dialogue, which will be called from the main form to confirm saving the changes made to the current file edited. This would normally be achieved by messageDlg() but I wanted this dialogue to have customised looks, so I am trying to achieve this functionality by case myDialogue.sh...

How to avoid the ding sound when Escape is pressed while a TEdit is focused?

In code I have developed some years ago I have been using this a lot to close the current form on pressing the Escape key at any moment: procedure TSomeForm.FormKeyPress(Sender: TObject; var Key: Char); begin if key = #27 then close; end; This behaviour is defined for the TForm. The form's KeyPreview property is be set to True to ...

Key down event affected by buttons

Hi everybody, I'm new around here and i have a little problems with a C# application. I want to capture the key down event. This wasn't a problem at first but after i added some buttons to the form, the key down event of the form ignores the arrow keys and moves the focus from one button to the next.(The key up event works) Is there a w...

ComponentArt Grid OnKeyPress Reset

Is there a way to reset the on key press search value and state through code (C#)? The ComponentArt (CA) grid is being used to select a record from the database to update. I need to reset the search state when the update process is complete. For some reason the on key press search/filter stays after re-binding the CA grid. I had to man...

Readonly Input field will not fire OnKeyPress in IE6

I am implementing a special behaviour for the Enter key. The problem is my ASP.net library generates a readonly field; and when users tab into this field (tabbing into it is meaningful; so I want that behaviour) and press Enter to submit the form, it won't submit because it's a readonly field. I wrote a workaround that hooks up your ord...

Excluding form fields from keypress handler assigned to body

I have a keypress handler on a web page assigned to the body element. I really do want it to be active anywhere in the web page. Or so I thought. The keypress events in textual input forms also activate the body handler, which makes sense, but which I don't want. Ideally, I'd like to keep the keypress handler assigned to the body ele...

WinForms, Handling all keys = OnKeyPress + OnKeyDown, but how?

I've got one Form, custom drawing, no controls. When I need to get the input from the user I go to OnKeyDown event and then map event's KeyData to a string** - so that I can recognize that user has pressed "ctrl X", etc, so everything is almost ok... the problem is with different keyboard settings and language specific letters - so for...

Javascript problem with location.href.

Hello! I have a textbox and whenever the user presses a key it's checked to see if the user pressed enter. If the enter key is pressed, i want to add all the info in the textbox and transfer the user to a different url. <script language="javascript" type="text/javascript"> function checkEnter(e){ //e is event object passed from fun...

How can I check the new value of a text field on keypress?

I have a single form field and I need to be able to detect when the field changes and execute some additional code using the new value of the field. I only want to execute the code if the key pushed actually changes the value of the text box. Here's the solution I came up with. function onkeypress(e) { var value = this.value; // do ...

Javascript on second keypress

Hi I've been wondering if there was a simple way to detect if a user presses the same character on the keyboard twice within one second. I've written some code that kind of works but it's unreliable. var escapeCount = 0; function reset() { escapeCount = 0; setTimeout('reset();', 1000); } window.onload = function() { reset...

How do I make pressing the Enter key cause focus to move to the cell below like Excel's default behavior?

I am using an Infragistics UltraWinGrid v9.1. I want to allow the user to enter numerical data in a cell, press Enter and then have the focus on the cell below, like you see in Excel. It appears that the KeyUp event might be better than the KeyPressed event for this, but I keep throwing an exception that I have gone beyond the bounds of ...

Jquery + Update one textbox from another textbox inside a gridview

Consider a gridview row containing two columns... Each column has two textboxes... Onkeypress in the first textbox i have to update a value in the second textbox..... Is it possible with jquery.... EDIT: I want to show Closing Advance based on Advance Detucted textbox keypress ClosingAdvance=OpeningADvance-AdvanceDetucted.... <table...

Javascript fires two events - onkeypress and onclick

Problem is when I press a key over a radio button, element MyFunc fires twice - once for "onkeypress" event, another time for "click" event. Question "Why?" I need to handle this by two different ways, but now I can not recognize what initial event was. When I click a mouse it fires just for "click" event. <ul> <li> <input...

Delphi - OnKeyPress occurs before TStringGrid updates cell with new character

Coding in Delphi, attaching an OnKeyPress event handler to a TStringGrid: The OnKeyPress event fires before the grid cell that the user is typing into has actually updated its value with the key that has been pressed. This is obviously a problem, when I want to know what the contents of that cell are at this moment, as in, as the user ...

Can jQuery dynamically change a "username" field based on a "name" field?

Hi all, basically I have two input fields, "name" and "username". The idea is that the "username" field will change depending on what is entered into the "name" field - dynamically. I also need the username field to be in lowercase only and to change spaces into dashes. I was thinking using onkeydown but I couldn't get it to do anythin...

Dojo: How to get the latest value in a NumberTextBox on onKeyPress or onChange?

I have a bunch of NumberTextBoxes which I created programmatically. Now, I have to compute some values on keypress so I call a function for that... Looks something like this: ... <head> ... function setNumTextBox() { ... var val = { name: "mytextbox", onKeyPress: keyPressFxn } new dijit.form.NumberTextBox...

Android - How To Override the "Back" button so it doesn't Finish() my Activity?

I currently have an Activity that when it gets displayed a Notification will also get displayed in the Notification bar. This is so that when the User presses home and the Activity gets pushed to the background they can get back to the Activity via the Notification. The problem arises when a User presses the back button, my Activity ge...