/    Sign up×
Community /Pin to ProfileBookmark

Submit form

Hi,

I have a form with a couple of text boxes. However i do not wish to submit the form when users click “Enter” in one of the textboxes.

Is there a way to stop the form from submitting when a user clicks “Enter” in one of those textboxes? I want to submit the form ONLY when the user clicks on the “Submit” button.

Please help!

to post a comment
HTML

4 Comments(s)

Copy linkTweet thisAlerts:
@tomeiauthorMar 10.2003 — Yes i have a button type="submit". In fact i've tried it with a couple of forms. Everytime i click "enter" on a textbox, the form submits.

how can i stop this?
Copy linkTweet thisAlerts:
@thejoker101Mar 12.2003 — by "click enter" i think he means press enter on the keyboard.

actually my boss just asked me about this. in internet explorer, if you press enter it's like pressing enter on the first button in the tab order. and changing the tab order through tabindex doesn't help. Any way to set it to submit which button or turn it off completely?
Copy linkTweet thisAlerts:
@Aronya1Mar 15.2003 — This isn't a fix, but what if you used a field that required validation? Maybe a checkbox at the bottom of the form that has to be checked before the script will allow the form to be submitted. Add some instructions on the error window to remind the user to complete all fields, or whatever, and use the Submit button to send.

Hope that helps.

Aronya1
×

Success!

Help @tomei spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...