Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 210621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:01:19+00:00 2026-05-11T18:01:19+00:00

I’m wondering if there is a defined standard for what the default action is

  • 0

I’m wondering if there is a defined standard for what the default action is of various HTML elements. I’ve looked at the W3C’s HTML specification and while they are very precise with what attributes can be used with elements (and also some behavioural stuff such as exactly what gets included with form submission) there’s nothing about the behaviour of elements. I’ve also checked out the Mozilla JS reference, and found nothing there either.

In particular I’m looking for the default behaviour of a form submit button; I’ve seen in different places that its default action is to submit the form and alternatively that its default action is not to submit the form but rather to get focus. Accordingly, there seems to be no consensus on whether onclick="return false;" for a submit button will stop form submission or not.

(Edit for clarity – I’m not trying to do any form-level validation on the submit’s onclick or anything like that; if I were, I’d be using the form’s onsubmit instead. I really am specifically interested in catching clicks on the button and potentially not having it submit the form in this case. This might end up requiring the button’s onclick set some state that the form’s onsubmit inspects, but if I can just return false then that’s great. Even if not, it would then be critical what order the onsubmit and onclick handlers get fired (i.e. does the button dispatch the submit before running its click handler?) which again I haven’t seen specified anywhere.)

While it would be simply to code up a test, I’d rather rely on specs/documented behaviour rather than the results of a trivial test that would undoubtedly miss any subtleties should they exist. In particular, I ran a quick test last week that seemed to show it didn’t stop form submission, but running one today shows that it does. I have had no luck finding any sort of authoritative resource as to what browsers actually do when you interact with their elements (e.g. what the default action is, whether the onclick handler for a submit button fires before or after the form submission dispatch, etc.)

Any advice as to where to look in this case would be welcome.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:01:19+00:00Added an answer on May 11, 2026 at 6:01 pm

    The relevant documents are DOM3 Events and the HTML 5 specification.

    They might not have all information you need, but should. So if you find them lacking, please request those behaviors to be specified.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I am using Paperclip to handle profile photo uploads in my app. They upload
I have some data like this: 1 2 3 4 5 9 2 6
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.