473,511 Members | 15,178 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

disable enter key

Hi,

How do I disable the enter key for a "Form"? so that user has to click the
"Submit" button.
Is there a way of doing it other than using Java/VB script?

Thanks,
Stephen
Nov 20 '05 #1
1 4432
I'm not sure about web forms but this is how you would do it for windows
forms..
override the ProcessCmdKey function of the form as below:

Protected Overrides Function ProcessCmdKey(ByRef msg As
System.Windows.Forms.Message, ByVal keyData As _
System.Windows.Forms.Keys) As Boolean
Select Case CType(msg.WParam.ToInt32, Keys)
Case Keys.Enter
'indicates you've handled the message sent by the enter key
press here; basically, you're eating up these messages
Return True
Case Else
Return MyBase.ProcessCmdKey(msg, keyData)
End Select
End Function

I assume you need this functionality for web forms. As I said, I'm not
familiar with that area - Sorry :(
Maybe this would help a bit though...

Imran.

"Stephen" <st*********@hotmail.com> wrote in message
news:ed**************@TK2MSFTNGP11.phx.gbl...
Hi,

How do I disable the enter key for a "Form"? so that user has to click the
"Submit" button.
Is there a way of doing it other than using Java/VB script?

Thanks,
Stephen

Nov 20 '05 #2

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

Similar topics

5
33273
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"
3
3026
by: James P. | last post by:
Hello, How do I disable the Enter key so that it does not generate a new blank form when I hit the Enter key? I tried Tools - Options - KeyBoard: select "Don't Move" in "Move After Enter"...
2
2927
by: nicholas | last post by:
How can I disable the enter key on an asp.net page? As the default button is the first on the page, and as the enter key clicks the default button, and as my first button on the page is th...
1
2362
by: John Smith | last post by:
Hi, How can I disable enterkey in a form. I have using couple of asp textboxes, one asp button for search and two Image Buttons, one for Back and other for continue. But If I click on the text...
13
14557
by: Rich | last post by:
Hello, So I would like to disable a textbox on a vb.net form without the text getting grayed out. In vb6 I could place a textbox control on a frame control and disable the frame leaving the...
1
1993
by: Daren Hawes | last post by:
Hi, I have a ASP.NET 1.1 page that in top corner has a login box & button. Then a large form. Users can fill out the form and press enter, but it actually submits the login not the one I...
3
11962
by: vanya | last post by:
i have been tryin to program(javascript) to disable the following keystroke combinations CTRL+O or CTRL+L Go to a new location (O = 79 L = 76) CTRL+S Save the current page ( S = 83) CTRL+E...
0
2437
by: joe | last post by:
How to disable imagebutton postback when i enter "enter" i just want postback when click mouse
16
6630
by: nagmvs | last post by:
Hi, Can any one tell me How to disable Keyboard Functions using JavaScript.If knows please tell me the code.Also tell me the code for mouse disable also. Thanks, Nagesh.
8
5404
by: alamodgal | last post by:
hiiiiiiiiiii everybody, pls solve my problem if u can? Actualy what happens in my site when i press enter key it will show some secured...
0
7237
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
7417
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...
1
7074
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...
0
5659
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,...
0
4734
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...
0
3219
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...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.