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

Suppress <return> for form submission?

I have a form for which I'd like all submissions to happen through the
submit buttons provided. But if the user enters a <returnwhile in any
text box, the form gets submitted, and it gets submitted as if the
first submit button defined for the form had been pressed. Can I
insure that pressing <returnwill not submit the form?

thanks, --thelma
Apr 4 '08 #1
8 1820
th****@uwm.edu a écrit :
I have a form for which I'd like all submissions to happen through the
submit buttons provided. But if the user enters a <returnwhile in any
text box, the form gets submitted, and it gets submitted as if the
first submit button defined for the form had been pressed. Can I
insure that pressing <returnwill not submit the form?
Yep, but not through PHP. Refers to a javascript newsgroup please.

Regards,
--
Guillaume
Apr 4 '08 #2
th****@uwm.edu schreef:
I have a form for which I'd like all submissions to happen through the
submit buttons provided. But if the user enters a <returnwhile in any
text box, the form gets submitted, and it gets submitted as if the
first submit button defined for the form had been pressed. Can I
insure that pressing <returnwill not submit the form?

thanks, --thelma

Hi Thelma,

Yes, clear.
Go to your php.ini on the webserver, and find the following line:

browserHitReturnWillPostForm = 0

In case you cannot find that line, as I expect, repost your question to
a group that is relevant.
eg:
comp.infosystems.www.authoring.html

PHP is a serverside language, not a webbrowser.

Regards,
Erwin Moller

PS: I am a bit grumpy today since I had to throw away my 'OS' because it
kept malfunctioning.
Apr 4 '08 #3
On Apr 4, 8:50 am, the...@uwm.edu wrote:
I have a form for which I'd like all submissions to happen through the
submit buttons provided. But if the user enters a <returnwhile in any
text box, the form gets submitted, and it gets submitted as if the
first submit button defined for the form had been pressed. Can I
insure that pressing <returnwill not submit the form?

thanks, --thelma

a 10 second google search for suppress return submit revealed this
informative page:

http://www.arraystudio.com/as-worksh...-keypress.html

BUT!

Since it is javascript some people may have it disabled.

I allow for the enter to submit but on long forms I include an extra
checkbox called 'finished' until that is checked PHP always exits back
to the from, that way any mis-typed enters won't make the user submit
incomplete data.
Apr 4 '08 #4
la***@portcommodore.com wrote:
: On Apr 4, 8:50 am, the...@uwm.edu wrote:
: I have a form for which I'd like all submissions to happen through the
: submit buttons provided. But if the user enters a <returnwhile in any
: text box, the form gets submitted, and it gets submitted as if the
: first submit button defined for the form had been pressed. Can I
: insure that pressing <returnwill not submit the form?
: >
: thanks, --thelma
: a 10 second google search for suppress return submit revealed this
: informative page:

Yes, my google search found the same kind of solutions. I was
hoping for a php workaround like what you suggest below.

thanks, --thelma

: http://www.arraystudio.com/as-worksh...-keypress.html

: BUT!

: Since it is javascript some people may have it disabled.

: I allow for the enter to submit but on long forms I include an extra
: checkbox called 'finished' until that is checked PHP always exits back
: to the from, that way any mis-typed enters won't make the user submit
: incomplete data.
Apr 4 '08 #5
..oO(th****@uwm.edu )
>I have a form for which I'd like all submissions to happen through the
submit buttons provided. But if the user enters a <returnwhile in any
text box, the form gets submitted, and it gets submitted as if the
first submit button defined for the form had been pressed. Can I
insure that pressing <returnwill not submit the form?
Not really.

You have to validate your form data on the server anyway. If it's
incomplete, show the form again. Additionally you can't rely on a
particular submit button being triggered with [enter]. It's completely
up to the browser what to do with forms that have multiple submit
buttons.

Micha
Apr 4 '08 #6
Michael Fesser wrote:
.oO(th****@uwm.edu )
>I have a form for which I'd like all submissions to happen through the
submit buttons provided. But if the user enters a <returnwhile in any
text box, the form gets submitted, and it gets submitted as if the
first submit button defined for the form had been pressed. Can I
insure that pressing <returnwill not submit the form?

Not really.

You have to validate your form data on the server anyway. If it's
incomplete, show the form again. Additionally you can't rely on a
particular submit button being triggered with [enter]. It's completely
up to the browser what to do with forms that have multiple submit
buttons.

Micha
What happens if there is no submit button? just a javascript driven
clickable object to do the submit bit..?

Apr 4 '08 #7
On Apr 4, 2:40 pm, The Natural Philosopher <a...@b.cwrote:
Michael Fesser wrote:
.oO(the...@uwm.edu )
I have a form for which I'd like all submissions to happen through the
submit buttons provided. But if the user enters a <returnwhile in any
text box, the form gets submitted, and it gets submitted as if the
first submit button defined for the form had been pressed. Can I
insure that pressing <returnwill not submit the form?
Not really.
You have to validate your form data on the server anyway. If it's
incomplete, show the form again. Additionally you can't rely on a
particular submit button being triggered with [enter]. It's completely
up to the browser what to do with forms that have multiple submit
buttons.
Micha

What happens if there is no submit button? just a javascript driven
clickable object to do the submit bit..?
Awesome -- now I need to have Javascript enabled just to submit a
form. That's almost as bad as links that require it.
Apr 4 '08 #8
I have a form for which I'd like all submissions to happen through the
submit buttons provided. But if the user enters a <returnwhile in
any text box, the form gets submitted, and it gets submitted as if the
first submit button defined for the form had been pressed. Can I
insure that pressing <returnwill not submit the form?

thanks, --thelma
Well, if you're doing field validation, users will learn rather quickly
after a few dings about missing data<g>. Or as mentioned elsewhere,
disable Return

--
Regards,

Twayne

Open Office isn't just for wimps anymore;
OOo is a GREAT MS Office replacement
www.openoffice.org

Apr 5 '08 #9

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

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
4
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would...
4
by: higabe | last post by:
Three questions 1) I have a string function that works perfectly but according to W3C.org web site is syntactically flawed because it contains the characters </ in sequence. So how am I...
4
by: Sarah | last post by:
Hi all. I have a form, and several text and image links on it that should submit the form with different actions. I prepared a simple page with just the code that's not working. PROBLEM:...
7
by: jerrygarciuh | last post by:
Hello, I have been playing with various Googled solutions for capturing the <Enter> key to suppress form submission. My first question is whether anyone has a script that works in all common...
2
by: Tom | last post by:
I have an (accesss) form with an IE control and want to use it to complete an (html) form that contains a TEXTAREA but hitting <return> transfers control to another control on the (access) form...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
3
by: jackiepatti | last post by:
QUESTION: I have a web page containing a form that contains an image instead of a submit button, e.g. <form name='myform' action='get' method='otherpage.asp'> <input type='image'...
1
by: almurph | last post by:
Hi everyone, I'm a newbie to vb.net. I have written some code to detect when a user presses the down-arrow, up-arrow and enter button. Essentially the user can arrow down or up through a...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
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...

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.