Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 2nd, 2005, 05:16 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default Press enter in TextBox

Hi,

I have 4 textboxes and 4 image buttons on webform. When I press enter on one text box then click event of first image button fires. I like to call my own function when I press enter in a textbox. Why click event of first image button get fire ?

Thanks in advance....


 
Old September 2nd, 2005, 05:19 AM
Authorized User
 
Join Date: Jul 2005
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Suresh,

You can use a JavaScript document.onKeyPress event and trap the event keyCode (13) and when the match occurs, you can submit the form.

Vasudevan Deepak Kumar
Personal Web: http://www.lavanyadeepak.tk/
I Blog At: http://deepak.blogdrive.com/
 
Old September 2nd, 2005, 06:25 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 104
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sureshbabu Send a message via Yahoo to sureshbabu
Default

HI,

   Actually My Problem is ..
   I have one page with one user control. On my page i have one text box(tx1) and one image button(img1) and also i have one more text box(txt2) and image button(img2) in user control. search functionalities of those two are different. Suppose when i enter some thing in txt1 and press enter then search functionlity that is written in user control (img2) is firing. How to restict that. I want the functionality of img1.

I opened some other project there i took one text box and two image buttons. If i enter some thing in the text box and click enter then no button code is firing(either of the buttons img1, img2). What is the reason beyond that?

Can u please give some cluse what to do?

Thanks
suresh





 
Old September 2nd, 2005, 08:42 AM
Authorized User
 
Join Date: Jul 2005
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can have the keyPress eventHandler in JavaScript with the 'this' argument, which would signify which textbox is being called.

Then detect event.keyCode (13). Depending upon the textbox, call the appropriate form submission.

Vasudevan Deepak Kumar
Personal Web: http://www.lavanyadeepak.tk/
I Blog At: http://deepak.blogdrive.com/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Enter as a valid entry in a textbox (VB) Grimgore BOOK: Visual Basic 2008 Programmer's Reference ISBN: 978-0-470-18262-8 2 February 9th, 2009 04:37 PM
enter key on textbox, performs button event code?? squeakstar Visual Basic 2005 Basics 4 June 22nd, 2006 05:13 AM
keydown/press r.parolari BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 1 March 17th, 2006 09:34 AM
Force a Key Press? ashley_y VB How-To 2 January 9th, 2004 03:59 PM
what happens when u press on a button? TaLz VS.NET 2002/2003 2 September 24th, 2003 12:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.