473,385 Members | 1,373 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,385 software developers and data experts.

How to disable or assign a enter key to a particular group of controls

Hi friends

I want to disable a enter key in my page. Because I m having two submit buttons in my page for two particular group of controls value submission. One group for registration and another for login in the same page itself. Is there anyway control within .net programming or client side javascript? Could you tell me how to assign the particular submit button to a particular set of group controls.



Advance thanks for your help.
Sep 20 '08 #1
1 1251
balabaster
797 Expert 512MB
The only way to disable the keypress is to catch it in JavaScript...of course, if the user turns off JavaScript, it will bypass this. So it's not foolproof.

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2.     window.onload = function(){
  3.         document.body.onkeypress = function(event){
  4.             var evt = window.event||event;
  5.             if (evt.keyCode = 13){
  6.                 evt.handled = true;
  7.             }
  8.         }            
  9.     }
  10. </script>
Sep 20 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Megan | last post by:
Hi everybody- I have 2 tables, Hearings and Rulings. Both have primary keys called, CaseID, that are autonumbers. I don't want both tables to have the same autonumber. For example, if Hearings...
2
by: Will | last post by:
I have a form which has a field Start Date. I want to only let the user enter a date if there is no date in the field and never be able to edit the field. I have experimented with On Enter and On...
1
by: Chip | last post by:
I'm using Andy Smith's RowSelectorColumn control (great control) and I'm not sure if this question is generic to all datagrid controls or this particular one. Is there a way to disable one of...
3
by: Stephen | last post by:
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
6
by: GD | last post by:
Hi, I wonder how to disable the "submit" behavior of a button. What I want is to assign values to dynamically added user controls without page postback. Problem: dynamically created control can...
13
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...
16
by: MLH | last post by:
If I give someone a runtime app, they can open the database window by pressing the F-11 key. How to prevent???
4
by: SteveKlett | last post by:
I have a subset of form items that I need to perform different operations on (enable/disable, clear values, change style, etc) rather than hard code the IDs or names I would like to recursively...
4
by: Jon Slaughter | last post by:
Is there any method to temporarily disable focus changing?(I assume only method is tab or mouse?) This problem has been tieing me up for a while and nothing seems to work. The only thing that I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.