473,698 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Catching [enter] in dropdownlist control

Hi

I have a problem delegating a [enter] keydown event to a button control when
inside a a DropDownList control.

I have this

Enter name: [Textbox] Select Birth year [DropDownControl] [Button].

When the cursor is in the textbox i can catch the button event by assign
button as default button. But when inside the DropDownList the button event
is never executed. I want this behavior for userablity reason.

Any suggestions?

Thanks in regards
Anders Jacobsen
Nov 18 '05 #1
3 1853
I don't think you can. I say that because: if you go to google's advanced
search (http://www.google.com/advanced_search?hl=en) and type some text in a
textbox and hit enter, it submits. If you put the focus on a dropdown box,
it doesn't. Hey if google can't do it...

It might be possible to get a keydown event on the body, see what the event
target was and do something from that though...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Anders K. Jacobsen [DK]" <no**@at.all> wrote in message
news:eD******** ******@TK2MSFTN GP10.phx.gbl...
Hi

I have a problem delegating a [enter] keydown event to a button control when inside a a DropDownList control.

I have this

Enter name: [Textbox] Select Birth year [DropDownControl] [Button].

When the cursor is in the textbox i can catch the button event by assign
button as default button. But when inside the DropDownList the button event is never executed. I want this behavior for userablity reason.

Any suggestions?

Thanks in regards
Anders Jacobsen

Nov 18 '05 #2
A thought; set a flag in your JS on the onFocus event for the dropdown.
Then if the form submits you could check that the onClick event has been
fired for the Submit button.

You can trap buttons on the <body> tag. For instance this traps the esc
key.

<body onkeypress="if (window.event.k eyCode=='27') DoSomeFunction( );">
Glenn
Nov 18 '05 #3
>A thought; set a flag in your JS on the onFocus event for the dropdown.
Then if the form submits you could check that the onClick event has been
fired for the Submit button.

You can trap buttons on the <body> tag. For instance this traps the esc
key.

<body onkeypress="if (window.event.k eyCode=='27') DoSomeFunction( );">


I will look into it. I wil post back with the posible solution.

Anders
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5480
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new dropdownlist to the screen for selection. This continues until there are no children, and then it checks for a help article list based on that last selection and displays actual articles for display. Adding the controls and getting everything...
2
17018
by: Dominic | last post by:
Hi guys, I'm not sure if this question belongs to FAQ, but I couldn't find a concrete answer. I created a Datagrid control using ItemTemplate, but it's NOT a in-place editing datagrid. One of the columns of the data grid contains a DropDownlist. I managed to create this datagrid control as follows.
5
2936
by: Eric | last post by:
Hi All, I'm very experienced in traditional ASP and am new to (am learning) ASP.NET. FYI: I am initially learning ASP.NET with VB.NET to ease the transition for me. I have encountered what I believe to be a huge limitation with ASP.NET and I'm wondering how you have handeled this problem. Let's suppose you have a page where the user can do one of two things: add a "Category", or add a "Movie Title" to an already existing category. ...
10
5314
by: Sacha Korell | last post by:
I'm trying to load a drop-down list with all DropDownList control names from another page. How would I be able to find those DropDownList controls? The FindControl method will only find a certain control by id, but I want to find all controls of a certain type (DropDownList in this case). Is there an easier way than to get a control count of the page, loop through all controls on that page, examine their type and, if they're a...
2
16092
by: glenn | last post by:
Hi folks, I am trying to determine which item in a DropDownList Web control has been selected. I have posted an OnSelectedIndexChanged subroutine in my code with a reference to the subroutine in my asp tag as shown here: <asp:DropDownList id="ddlTo" runat="server"
15
3111
by: glenn | last post by:
Hi folks, I have a DropDownList in a DataGrid that is populated from records in a database. I want to add a value that might be a string such as "Select a Company" for the first item since an OnSelectedIndex event is not fired if you select the first item. Does anyone know of an easy way to do this?
2
8005
by: Ted Ngo | last post by:
Hi All, I did create a dropdownbox and populate the data from the database. I want the user able to enter the text or select data from the dropdownlist box. When the user enter the text and if it match the data in the dropdownlist box then those data will display. I want to do something like, in the IE, where the user enter the world wide web Address.
1
4655
by: MaryamSh | last post by:
Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button ,another row will be created with the same control (I mean another dropdown and 2 button) and so on. and by pressing Remove button the selecetd row will be removed. I used viewstate to keep my value for postback, I want by changing selectedvalue of...
0
3498
by: MaryamSh | last post by:
Create Dynamic Dropdownlist Controls and related event -------------------------------------------------------------------------------- Hi, I am creating a Dynamic Search in my application. I create a user control and in Page_load event I create a dynamic dropdownlist and 2 dynamic button (Add,Remove) By pressing Add button ,another row will be created with the same control (I mean another dropdown and 2 button) and so on. and by...
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8611
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
9170
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...
1
8904
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
8876
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
7741
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
6531
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
5867
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
4372
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...

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.