473,404 Members | 2,137 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,404 software developers and data experts.

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 1913
Thats more of HTML question, but im in a good mood ;)
just replace the submit button with <input type='button' onclick='this.form.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.form.submit()'>

hope it helps.


Don't forget to transform gracefully [1]:

add
<noscript><input 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="buttonname" 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
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....
3
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...
4
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...
1
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...
8
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"...
4
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...
3
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...
10
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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,...
0
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
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,...

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.