473,786 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RETURN shall not submit a form

Hello,
I have the problem that I want to submit a form only if the submit button is
clicked with the mouse.
The form should not be submitted if the user hits the RETURN key.

Any suggenstions?

Thanks
Christoph
Jul 17 '05 #1
4 1932
Thats more of HTML question, but im in a good mood ;)
just replace the submit button with <input type='button' onclick='this.f orm.submit()'>

hope it helps.

U.
"Christoph Weber" <ch************ *@im-achental.de> wrote in message news:2g******** ****@uni-berlin.de...
Hello,
I have the problem that I want to submit a form only if the submit button is
clicked with the mouse.
The form should not be submitted if the user hits the RETURN key.

Any suggenstions?

Thanks
Christoph

Jul 17 '05 #2
Uzi Klein wrote:
"Christoph Weber" <ch************ *@im-achental.de> wrote in message news:2g******** ****@uni-berlin.de...
Hello,
I have the problem that I want to submit a form only if the submit button is
clicked with the mouse.
The form should not be submitted if the user hits the RETURN key.

Any suggenstions?

Thanks
Christoph

Thats more of HTML question, but im in a good mood ;)
just replace the submit button with <input type='button' onclick='this.f orm.submit()'>

hope it helps.


Don't forget to transform gracefully [1]:

add
<noscript><inpu t type="submit"/></noscript>
to your HTML.
[1] http://www.w3.org/TR/WAI-WEBCONTENT/...orm-gracefully

--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #3
Christoph Weber wrote:
I have the problem that I want to submit a form only if the submit button is
clicked with the mouse.
The form should not be submitted if the user hits the RETURN key.

Any suggenstions?


Click the submit button with your mouse and don't hit the RETURN key.

--
Jock
Jul 17 '05 #4
Christoph Weber schrieb im Artikel <2g************ @uni-berlin.de>:
clicked with the mouse.
The form should not be submitted if the user hits the RETURN key.


You could give the submit button a name and check in your form if the
variable $_POST[buttonname] (resp. $_[GET]....) is empty respectively set.
e.g.:
<form name="somewhat" action="my_php_ form.php" method="post">
[...]
<input type="submit" name="buttonnam e" value="click me">
</form>
in your evaluation form you may try using:

if (empty($_POST[buttonname]))
{
echo "please click button for submit";
exit;
}

--
PGP key available
Jul 17 '05 #5

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

Similar topics

10
3099
by: Don | last post by:
I want the server-side php script to return a browser page that is essentially a copy of the original client page that contained the <form> which referenced the php script in the first place. However, the php script will need to change a couple html lines in that returned page. I sure could you some help on how to go about this. Thanks in advance, Don ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
3
4542
by: Varun | last post by:
Hi There, I have a form("myRequest.asp") and the values from it are retrieved into the page ("output_Print.asp") on which I have two buttons('Save As Complete' and 'Save As Incomplete'). When the 'Save as Incomplete' button is Clicked the form will be going to the "SaveAsincomplete.asp" without validation of the fields. And when the 'save as complete' is clicked certain fileds are to be validated and by the function return value, if false...
4
2341
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I need to: 1. Click a submit button on an asp page, calling another page that saves the contents of that form to a database and then displays
1
3438
by: Piotr | last post by:
I have popup window (window.open) where I put any value in input field. After submit I wan to to return to the main window and get value from popup window. How to close popup window and return to the main after submit?
8
2077
by: bdobby | last post by:
Hi. I am relatively new to js, but I did think I was starting to get the hang of it. Then this happened... I have a form with an onsubmit event handler: <form id="uploadForm" method="post" action="..." onSubmit="checkDates()"> The event handler does some minor validation, then returns true or
4
4985
by: d3vkit | last post by:
I have a form on my page, and some javascript which uses ajax to submit the form, and then opens the new page in a div using ajax so there is no refresh. This works fine. But the problem is this: all values seem to pass except what the submit buttons say. I have a preview button and a finish button, and need to check which was pressed. I can add a checkbox for submit, but that's annoying. I'm using mootools for the ajax call, so it might not...
3
5065
by: Anthony | last post by:
I have a form on a web page that requires to click on a button to submit the information. I have two questions about changing this form: 1. Is there a way that I can change the script so that the form can be submitted by hitting the enter key? 2. Is there a way that I can have the Username and Password boxes cleard after the form is submitted? You probably don't need the code for the form as it is pretty basic but here it is just in...
10
5538
by: Tim Streater | last post by:
I have a form and a button to submit it. The button is made from: <input type=button onclick='myHandler(this.form);'> This all works fine except that in Safari 2.0.4, the enter/return keys, if pressed, submit the form - bypassing my onclick handler. I can partially fix this with: <form onsubmit='return false;'>
5
11663
by: GiJeet | last post by:
Hello, I'm trying to figure this code out. <input type="submit" onclick="if(!confirm('Are you sure?') return false; "... /> I know that if you return false in an event like this onclick it prevents the default behavior of the event. So, in the onclick of a button the default behavior is to submit the form. Confirm returns the value 1 if the user clicks OK and the value 0 if
0
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9961
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8989
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7512
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6745
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4066
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.