Solved

Disable Enter Button ASP.Net

Posted on 2010-09-11
4
569 Views
Last Modified: 2012-05-10
Hi There

I have two forms on a page each form has its own asp:imagebutton and validation group.
When the user clicks enter on the keyboard it posts the first form.

How do I disable pressing enter on the keyboard and force them to use the form buttons.
0
Comment
Question by:Stanton_Roux
4 Comments
 
LVL 12

Expert Comment

by:HugoHiasl
Comment Utility
I think this article handles what you need.:

http://www.cs.tut.fi/~jkorpela/forms/enter.html

I used it in a similar way before.
0
 
LVL 10

Expert Comment

by:krunal_shah
Comment Utility
0
 
LVL 7

Expert Comment

by:meispisces
Comment Utility
http://www.felgall.com/jstip43.htm

hope this helps, if not pls let me know!
0
 
LVL 9

Accepted Solution

by:
abhinayp86 earned 500 total points
Comment Utility
a Form or an asp:panel has an attribute called DefaultButton. On on enter hit, the default button is triggered

 

.
.
.
.
.
.
.
.
 



To force ppl to click button, set the default button to some textbox or a label.

   
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now