473,387 Members | 1,572 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.

Multiple forms on aspx and ENTER key

I received a design change to add an additional search textbox to our header
control for completely different type of search than one on the left side of
the page. Each search textbox is submitted by different linkbuttons to allow
me to handle each click event on the postback.

My problem is handling what happens when a user presses ENTER. I could trap
the Keypress event to check that they've entered text by checking which
textbox has focus and if they did, call the click() event, but I don't see a
way to determine focus in javascript. Any suggestions would be appreciated in
handling these multiple forms.

Thanks.
Nov 19 '05 #1
2 2117
Dave,

I have a javacript object that is free and comes with all source code. It
has a few handy javascripts in it. One of them lets you specify which button
is clicked when you press enter while in a text box.

You may find a demo of all the scripts the component has and a download for
the component here: http://www.aboutfortunate.com?page=javascriptdemo

If you have any questions about the component feel free to email me.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Dave" <Da**@discussions.microsoft.com> wrote in message
news:99**********************************@microsof t.com...
I received a design change to add an additional search textbox to our
header
control for completely different type of search than one on the left side
of
the page. Each search textbox is submitted by different linkbuttons to
allow
me to handle each click event on the postback.

My problem is handling what happens when a user presses ENTER. I could
trap
the Keypress event to check that they've entered text by checking which
textbox has focus and if they did, call the click() event, but I don't see
a
way to determine focus in javascript. Any suggestions would be appreciated
in
handling these multiple forms.

Thanks.

Nov 19 '05 #2
You can associate each textbox on the webform to a button by adding
onKeyPress="fnTrapKP('Button1');" where fnTrapKP would trigger
Button1.Click(); when the user presses Enter within that textbox.

You may review this demo
http://www.societopia.net/samples/ASPPage_Buttons.aspx
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Dave" wrote:
I received a design change to add an additional search textbox to our header
control for completely different type of search than one on the left side of
the page. Each search textbox is submitted by different linkbuttons to allow
me to handle each click event on the postback.

My problem is handling what happens when a user presses ENTER. I could trap
the Keypress event to check that they've entered text by checking which
textbox has focus and if they did, call the click() event, but I don't see a
way to determine focus in javascript. Any suggestions would be appreciated in
handling these multiple forms.

Thanks.

Nov 19 '05 #3

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

Similar topics

2
by: Senthil | last post by:
1. Created a new C# web application project 2. Change the name of webform1 to login.aspx 3. And in the .cs file change the name of the class to login, and include System.web.security namespace....
6
by: mark | last post by:
I have an asp.net ecommerce web application on a remote web server. I'm using an Access database on the back end. I've notice a few strange things. When I mimic an multiple user environment by...
3
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be...
1
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The...
0
by: Anonieko Ramos | last post by:
ASP.NET Forms Authentication Best Practices Dr. Dobb's Journal February 2004 Protecting user information is critical By Douglas Reilly Douglas is the author of Designing Microsoft ASP.NET...
8
by: TJS | last post by:
what are folks doing to get around limitation of one server form per page ?
6
by: Manny Chohan | last post by:
I am using forms authetication in the web config. i can validate a user against a database and click on images which makes hidden panels visible.However when i click on the link inside a panel...
5
by: Alex Maghen | last post by:
In ASPX 2.0 with MasterPages and all that, my entire page only has one actual <FORM>. But there are several different sections of the page that provide what are functionally separate forms with...
5
by: c676228 | last post by:
Hi everyone, my colleagues are thinking about have three insurance plans on one asp page: I simplify the plan as follow: text box:number of people plan1 plan2 plan3
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.