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

disable enter within form

Hi Folk

I have a form with the following structure:

<form onsubmit="getsearchdata();">
lots of input boxes here
<input type="submit" name="submit" onsubmit="getsearchdata();">
</form>

In Opera, whenever someone presses the <enterbutton, the form is
submitted and the onsubmit does not event get any attention. When the
submit button is clicked, it obviously works....

How can I change this?

TIA
Nicolaas
Feb 25 '07 #1
2 1958
On Feb 26, 11:13 am, "windandwaves" <nfranc...@gmail.comwrote:
Hi Folk

I have a form with the following structure:

<form onsubmit="getsearchdata();">
lots of input boxes here
<input type="submit" name="submit" onsubmit="getsearchdata();">
</form>

In Opera, whenever someone presses the <enterbutton, the form is
submitted and the onsubmit does not event get any attention. When the
submit button is clicked, it obviously works....

How can I change this?

TIA
Nicolaas- Hide quoted text -

- Show quoted text -
I think I solved it by changing it as follows:

<form onsubmit="return !getsearchdata();">
lots of input boxes here
<input type="submit" name="submit" onsubmit="return !
getsearchdata();">
</form>

Ta

Nicolaas

Feb 25 '07 #2
windandwaves said the following on 2/25/2007 5:27 PM:

<snip>
I think I solved it by changing it as follows:

<form onsubmit="return !getsearchdata();">
Either way, you must return a value for it to make any difference of
whether the form gets submitted or not. Whether it is !getsearchdata()
or getsearchdata() depending on what the function returns.
lots of input boxes here
<input type="submit" name="submit" onsubmit="return !
getsearchdata();">
There is no onsubmit handler for a submit button. The onsubmit here is
wasteful and unneeded.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 26 '07 #3

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

Similar topics

5
by: http://links.i6networks.com | last post by:
I want to force the users to click submit to submit the forms. How do I disable "Enter Key" which will submit the form automatically when they entered the data in text field then pressed "enter key"
3
by: James P. | last post by:
Hello, How do I disable the Enter key so that it does not generate a new blank form when I hit the Enter key? I tried Tools - Options - KeyBoard: select "Don't Move" in "Move After Enter"...
1
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
1
by: John Smith | last post by:
Hi, How can I disable enterkey in a form. I have using couple of asp textboxes, one asp button for search and two Image Buttons, one for Back and other for continue. But If I click on the text...
1
by: Daren Hawes | last post by:
Hi, I have a ASP.NET 1.1 page that in top corner has a login box & button. Then a large form. Users can fill out the form and press enter, but it actually submits the login not the one I...
2
by: letam | last post by:
Hello, Thank you in advance for any help, it will be most appreciated! I need to be able to disable several text fields, until the user enters a value in a certain text field. Once they enter a...
0
by: Webmills | last post by:
Hi I have a log out button at the top of my site. It is contained within a web control within the master page. Because it is the first button on the page, then by default it is the one that...
1
by: scanreg | last post by:
My form needs to (1) direct to specified URLs based on a combination of form selections and (2) enable/disable form features based on selections within the form FORM Radio 1 - A - B - C ...
3
by: pushrodengine via AccessMonster.com | last post by:
Within the form “frmIncidentForm” I have a textbox and a command button. I would like to disable the “AddIncident” button when the “IncidentID” textbox is NOT empty. If possible I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.