473,651 Members | 2,496 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

please anybody help to solve keydown event for enter button problem

7 New Member
Hi,


I am working in asp.net with C# web application, i have used one textbox and image button for search

funtion, i have created one user control for this, but after i have entered value in textbox, i have pressed the

button, its not at all working, if i will use mouse i can able to search values, how to enable to enter key at

keydown event of textbox, the following script i have used ,


function Buttonfocus()
{
if(event.which || event.keyCode)
{
if ((event.which == 13) || (event.keyCode == 13) || (event.which == 10) || (event.keyCode == 10))
{
document.getEle mentById("go"). click();
return false;
}
}
else
{
return true;
}
}

Please anybody to help me solve this problem in my application, advanced thanks for any reply.

Thanks.
Mar 8 '07 #1
1 2081
acoder
16,027 Recognized Expert Moderator MVP
See this page for a cross-browser way of accessing event properties.

You need to have an argument in the function for this to work in all (most) browsers.
Mar 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2989
by: mee-shell | last post by:
Hi, I am a python newbie. I have created a tool for capturing the screen shot. I want to be able to do the screen capture with the keydown event as well. The tool worked fine when it first opened. However, if I keep the tool open, and open another window to do the screen capture, the tool will lose its focus, and the keydown event will not work anymore. I wonder if any of you can help me to solve this problem of how to get the focus...
3
9217
by: bardo | last post by:
I have a Datagrid that is inside a panel. I want to use the keyDown event to reconize the arrow keys. But I have no luck at all. The problem is that the keydown event won't fire at all, unless I click on a row (withs will turn blue then) and then click on it again . Now if I press any key the event will fire (except for the arrow keys). I also tried to override the IsInputKey => no luck. I also tried to override the ProcessCmdKey => With...
2
1913
by: Helen Trim | last post by:
I am struggling to get the keydown event for checkboxes to work when pressing down arrow and enter. The so-called help talks about overriding the IsInputKey method for the controls, but doesn't give an example. How do I override a control's method? TIA -- Helen
2
1442
by: GS | last post by:
on a control, keydown was never triggered Private Sub addressBar_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) .... end sub on the hand the following got executed Private Sub addressBar_textchanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles addressBar.TextChanged
2
1561
by: rocksoft | last post by:
Hi I am working in asp.net with C# web application, I have used visual studio 2003, i have used dropdownlist in my application to populate the data from mysql database, i have got problem while i selected the item from dropdownlist, its not selecting correct item i'm selecting from dropdownlist, i have 64 records in my table, but i tried to work with upto 15 records it will not giving problem, when the scroll will enable to dropdownlist...
1
5838
by: dana1 | last post by:
I have a form with several combo boxes in the header used to determine the records that will be displayed on the form. When I tab or enter from the last combo box in the header, I want the focus to move to the first control on the form. When I Shift+tab from the first control on the form, I want the focus to move to the last control in the header. The form is a continuous form. The first control on the form is either a text box or a combo...
1
4753
by: kgerritsen | last post by:
I am building an application that will receive input from a barcode scanner. The barcode scanner is configured to append to the front value a single character and hyphen that identify the barcode standard, then the value in the barcode, terminated by a return. The barcode scanner appears to the operating system as a USB keyboard. I am loading the barcode value into a textbox both on my Form1 and on a dialog box where the user has to...
9
4034
by: pvsundarram | last post by:
hey, i am trying to cancel the keydown event for certain keycodes( for eg:- enter key ).But the cancelling of this event is not happening in firefox. Is there any way to cancel the event in the iframe. CODE ===== <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en_US"
2
2806
by: lenniekuah | last post by:
Hi Friends, Encounter another interesting problem of practical event. I have used FORM KEYDOWN event to navigate the cursor and on the Primary Key TextBox I tried to validate the input after ENTER was pressed it does not work. Here are the coding private void FrmCustomerRef_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { this.Close();
0
8275
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
8697
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8579
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7297
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
6158
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
4144
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
4283
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1909
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.