473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

controlling "return key" behavior with multiple "form-elements"

Hi there,

we have an application which is built with several ASCX controls some of
which contain form elements (e.g. Textboxes, Buttons etc.)

For example: in the top section (one ascx-control), there is a
textbutton in which the user can enter a string to search for. There's
link button right next to that textbutton. Then, in the "content
section" (another ascx-control), there may be a login-dialog which
prompts the user for login-name and password, with another button "Login".

How can we make sure that when the user has entered his login data and
enters "return" (instead of clicking the button), the event handler of
the button is fired instead of firing the event handler of the
search-button? And vice versa: when the user has entered a search string
in the search-textbox and enters "return", how can we make sure this
"search-button" event handler is fired instead of any other "subforms"
event handler.

We cannot have multiple forms as only one form is allowed per ASPX page
(even when distributed among severy ascx-controls).

kind regards,
david
Nov 18 '05 #1
1 1857
This might be helpful:
http://www.allasp.net/enterkey.aspx

Karl

"Holger (David) Wagner" <da***@purple-sunshine.de> wrote in message
news:cf**********@svr7.m-online.net...
Hi there,

we have an application which is built with several ASCX controls some of
which contain form elements (e.g. Textboxes, Buttons etc.)

For example: in the top section (one ascx-control), there is a
textbutton in which the user can enter a string to search for. There's
link button right next to that textbutton. Then, in the "content
section" (another ascx-control), there may be a login-dialog which
prompts the user for login-name and password, with another button "Login".

How can we make sure that when the user has entered his login data and
enters "return" (instead of clicking the button), the event handler of
the button is fired instead of firing the event handler of the
search-button? And vice versa: when the user has entered a search string
in the search-textbox and enters "return", how can we make sure this
"search-button" event handler is fired instead of any other "subforms"
event handler.

We cannot have multiple forms as only one form is allowed per ASPX page
(even when distributed among severy ascx-controls).

kind regards,
david

Nov 18 '05 #2

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

Similar topics

5
by: http://links.i6networks.com | last post by:
I want to force the users to click submit to submit the forms. How do I disable "Enter Key" which will submit the form automatically when they entered the data in text field then pressed "enter key"
2
by: Cindy | last post by:
Hi all you smarties out there, I'm having a little conundrum with my asp.net page Scenario: I have a form (asp.net) with no code behind (as yet). I have placed a javascript function on a...
0
by: Joeyej | last post by:
Hi - I'm trying to move/use a web form (containing some javascript field checks) previously hosted on a Windows 2000 server. However, the FORM METHOD="post..." command in the form (shown below)...
3
by: PJ6 | last post by:
I want to be able to, depending on the state of the page, direct what the ENTER key causes the page to do. The problem I'm having is I have a user control with a textbox and an "enter" button....
5
by: Lars Netzel | last post by:
Hey! I have tried...(in a datagrid) e.KeyDate.Return and e.KeyDate.TAB end e.KeyDate.Enter
0
by: Ralf Gedrat | last post by:
Hello! I have a Application, this throws after some time following exception: Item has already been added. Key in dictionary: "- 1" key being added: "- 1" I use Application.Run with...
13
by: kurtj | last post by:
Hello Gurus: I have a validation script (below) that is somehow messed up. If the Name field is blank, I get the alert message, then the browser window goes to a blank document with the word...
32
by: Axel Bock | last post by:
Hi all, I am trying to get my head around what happens if I return a class object from a function. It seems C++ (MinGW) does not invoke the copy constructor if I do something like this: ...
0
by: roxanaislam | last post by:
Hi: I have a search form in my application which has 4 dropdown list controls, one text box, one "GO" button, one "reset" button. When the "GO" button is clicked the form gets submitted and the...
4
by: roxanaislam | last post by:
Submitting Form by pressing the "ENTER" key -------------------------------------------------------------------------------- Hi: I have a search form in my application which has 4 dropdown...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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...

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.