473,507 Members | 5,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to stop a form from submitting when enter is pressed.

19 New Member
hi friends,i m facing a problem,when i press enter, the page has redirected to another page,which is given in <form method="get" action="get_order">.
Jun 25 '07 #1
4 1693
shoonya
161 New Member
can you explain your problem a bit ??
your title and question doesn't co relate

shoonya
Jun 25 '07 #2
Purple
404 Recognized Expert Contributor
Hi shivendravikramsingh,

try this:

[HTML]<form method="get" action="get_order" onKeyPress="nullEnter()">[/HTML]

with this

Expand|Select|Wrap|Line Numbers
  1. function nullEnter(){
  2.     if(event.keyCode==13)
  3.         {
  4.         event.keyCode = null;
  5.         return;
  6.         }
  7. }
Regards

Purple
Jun 25 '07 #3
shivendravikramsingh
19 New Member
thanks,my problem is solved.
Jun 26 '07 #4
Atli
5,058 Recognized Expert Expert
I have edited the thread's title to better describe it's contents.

Moderator
Jun 27 '07 #5

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

Similar topics

15
6540
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
6
3068
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
2
1270
by: Astra | last post by:
Hi All In order for me to validate forms before they are submitted I use an INPUT type of button and fire the OnClick event to check the form before submitting. This is instead of the usual...
4
7545
by: Peloux | last post by:
Hi, I have written some htc in order to validate data in a form. most of htc are attached on 'onblur' event. Now, we would like to use the Enter Key to sublit form, so we use the following...
5
3609
by: Gu | last post by:
hi to all! how can i prevent the "return / enter" key to submit the current form if hit in a text input? i've actually added the code: onKeyPress="if(event.KeyCode==13){doGivenFunction();}" to...
5
4768
by: Wes | last post by:
Apparently some of our form users are trying to add new lines in a text field and are hitting the <enter> key thus causing the form to be submitted prematurely. There is no algorithm we can write...
16
2836
by: browntown | last post by:
so I have this application I'm nearly finished with. The only thing the client has requested is the ability to submit the form by pressing "enter". I didn't think this would be a huge pain in the...
24
8390
by: MichaelK | last post by:
Who knows how to prevent submitting a form on the press Enter button before all fields on the form are filled up. People just enter the first field hit Enter and it submits the form and doing...
1
3194
by: dittu | last post by:
How to close the popup window when submitting the form? I have a sample.jsp. In that page one button is there. when button pressed, open popup window contains one "text box" and one " submit...
0
7110
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
7372
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...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
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,...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
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
3191
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...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
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.